There's no way to <link rel=preload> a Web Worker. This fixes that.
npm i -S gist:developit/567dde2346d785b2628224fddbf6783c
<!-- workers are now just a normal script preload: -->
<link rel=preload href=/path/to/worker.js as=script crossorigin>| #!/bin/sh | |
| OPENSSL="openssl-1.1.1d" | |
| if [ -d ${OPENSSL} ]; then | |
| rm -rf ${OPENSSL} | |
| fi | |
| if [ ! -f ${OPENSSL}.tar.gz ]; then | |
| curl -O https://www.openssl.org/source/${OPENSSL}.tar.gz |
| function hyphenize(str) { | |
| // /y is to make sure that there are no characters between the matches | |
| // /g is so that .match() works the way we need here | |
| // /u is not strictly necessary here, but generally a good habit | |
| return str.match(/([a-z]{1,2})/uyg).join('-'); | |
| } | |
| assert.equal( | |
| hyphenize('hello'), 'he-ll-o' | |
| ); |
| import React, { useState, useEffect } from 'react' | |
| import { useDebounce } from './use-debounce' | |
| const MySearchComponent = props => { | |
| const [search, setSearch, { | |
| signal, | |
| debouncing | |
| }] = useDebounce('') | |
| const [results, setResults] = useState([]) |
| license: mit |
This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).
Matrix multiplication is a mathematical operation that defines the product of
| license: mit |
For this blog post we will be using ruby version 2.4.0 and rails version 5.1.4 as backend and React/Redux as frontend. Adding Google Sign in functionality in your application can be done in two popular ways.
Adding google sign in functionality in the frontend with google api client gapi.
Adding google sign in functionality logic in the backend server.
If your application has separate backendend with APIs feeding data to the frontend React application, I suggest you to follow the step 2. If you want yo enhance your application security, then you implement both.
| #!/usr/bin/env node | |
| // https://www.hackerrank.com/challenges/2d-array/problem | |
| class HourGlass { | |
| constructor(attrs, debug) { | |
| this.attrs = attrs | |
| this.debug = debug | |
| this.value = this.compute() | |
| } |