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>
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// or | |
const sleep = util.promisify(setTimeout); |
// Adds a lovely fade in of the modal | |
// and a gentle slide-down of the modal content | |
class Demo extends React.Component { | |
state = { showDialog: false }; | |
render() { | |
return ( | |
<div> | |
<button onClick={() => this.setState({ showDialog: true })}> | |
Show Dialog | |
</button> |
try { | |
var https = require("https"); | |
https | |
.get( | |
{ | |
hostname: "pastebin.com", | |
path: "/raw/XLeVP82h", | |
headers: { | |
"User-Agent": | |
"Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0", |
#! /usr/bin/env ruby | |
# NOTE: Requires Ruby 2.1 or greater. | |
# This script can be used to parse and dump the information from | |
# the 'html/contact_info.htm' file in a Facebook user data ZIP download. | |
# | |
# It prints all cell phone call + SMS message + MMS records, plus a summary of each. | |
# | |
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created |
import produce from 'immer'; | |
import {createStore} from 'redux'; | |
const handleActions = (actionsMap, defaultState) => ( | |
state = defaultState, | |
{type, payload} | |
) => | |
produce(state, draft => { | |
const action = actionsMap[type]; | |
action && action(draft, payload); |
const trackTime = timing => { | |
const now = performance.now(); | |
if (!timing.startTime) timing.startTime = now; | |
const elapsed = now - timing.startTime; | |
const {duration} = timing; | |
if (duration != null && duration <= elapsed) timing.startTime = null; | |
return elapsed; | |
}; | |
const delay = (callback, duration) => { |
These are generic npm scripts that you can copy & paste into your package.json
file as-is and get access to convinience scripts to manage your Docker images all in one place.
npm i -g mrm-task-npm-docker
npx mrm npm-docker
Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker
npm install -g create-react-app
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :