A quick demonstration of how Promises work with generator functions in ES6.
$ npm i
$ node_modules/.bin/babel-node promise-test.js
Output:
imaGenerator started
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="//code.jquery.com/jquery-2.1.1.min.js"></script> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <h1>Creating an offer using <a href="https://github.com/otalk/RTCPeerConnection">RTCPeerConnection</a></h1> | |
| <pre></pre> |
A quick demonstration of how Promises work with generator functions in ES6.
$ npm i
$ node_modules/.bin/babel-node promise-test.js
Output:
imaGenerator started
| # This script is the **correct** way to allow installation and use | |
| # of npm executables without sudo. | |
| # Declare where you want your global packages installed to. | |
| npm config set prefix '~/.local/share/npm' | |
| # Ensure the directory exists. | |
| mkdir -p ~/.local/share/npm | |
| # Change `.zshrc` to `.bashrc` if appropriate, but consider instead |
Generates hipster-ish Heroku-style names.
tattooed-skateboard-3254
try-hard-wolf-3343
pop-up-cronut-4510
heirloom-mimosa-3946
I write a pad function fairly often, and I've never been so satisfied with an implementation as I am with this one.
| // mounting plate thickness | |
| THICKNESS = 1.4*2; | |
| // measured from Gateron switch and DSA keycap | |
| SWITCH_WIDTH = 14; | |
| SWITCH_LIP_WIDTH = 15.65; | |
| SWITCH_LIP_THICKNESS = 0.95; | |
| SWITCH_CLIP_WIDTH = 3.8; | |
| SWITCH_CLIP_GAP = 1.4; | |
| SWITCH_CLIP_DEPTH = 0.7; |
I hereby claim:
To claim this, I am signing this object:
| var duration = 24*3600*1000; // 24 hours as milliseconds | |
| var halfLife = 5*3600*1000; // 5 hours as milliseconds | |
| var absorpLife = 3600*1000; // 1 hour as milliseconds | |
| var end = +(new Date()); | |
| var start = end - duration; | |
| var numSteps = 24*60; | |
| var step = duration/numSteps; | |
| var startVal = 106; | |
| var rows = []; | |
| var log2 = Math.log(2); |
| { | |
| "ExchangeServices": { | |
| "ExchangeServicePort": { | |
| "ResolveNames": { | |
| "input": "m:ResolveNamesType", | |
| "output": "m:ResolveNamesResponseType" | |
| }, | |
| "ExpandDL": { | |
| "input": "m:ExpandDLType", | |
| "output": "m:ExpandDLResponseType" |
Fork of Mike Bostock's Now + Solar Terminator with a different projection.