(None of this is official, and some of it should be very carefully used)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: stylesheet.css | |
upstream.scss: upstream.url | |
curl "`cat upstream.url`" > upstream.scss | |
node_modules/.bin/sass: | |
npm install sass | |
stylesheet.css: upstream.scss stylesheet.scss | |
node_modules/.bin/sass stylesheet.scss > stylesheet.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/** | |
* Delays the given number of milliseconds. | |
* @param {Number} ms the number of milliseconds to delay. | |
* @return {Promise} resolves after the delay has finished. | |
*/ | |
Promise.delay = (ms) => new Promise(resolve => setTimeout(resolve, ms)); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/** | |
* Wait for a condition to be true before continuing. | |
* @param {Number} [delay] a timeout (in ms) for when an error should be thrown for a function that will never be true. | |
* Defaults to `2000`. | |
* @param {Function<Boolean>} fn the function to poll to determine if the program should continue. | |
* Return `true` when the Promise should resolve. | |
* @return {Promise} resolves when `fn` returns `true`. Rejects with an `EvalError` if `fn` doesn't return `true` before `delay`. | |
*/ | |
window.waitFor = function(delay, fn) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<meta name="description" content="Browser testing with Mocha and Chai loaded through PolyGit"> | |
<title>Mocha Testing via PolyGit</title> | |
</head> | |
<body> | |
<script src="https://polygit2.appspot.com/components/webcomponentsjs/webcomponents-lite.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let x = new Error("Test"); | |
Promise | |
.resolve(x) | |
.then(() => console.log("Good")) | |
.catch() => console.log("Bad")); | |
// => "Bad" |
Download https://catalog.data.gov/dataset/national-park-boundariesf0a4c and extract CSV sheet.
cat ~/Downloads/nps_boundaries.csv | cut -d , -f 4 > ~/Downloads/national_parks.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"document": { | |
"$ref": "document.json" | |
}, | |
"value": { | |
"$ref": "document.json#bar/baz" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Created for http://stackoverflow.com/questions/34982953/child-process-stream-backpressure | |
Please pardon the CoffeeScript, but I couldn't stand to extend stream.Transform in native JavaScript. | |
### | |
fs = require("fs") | |
execStream = require("exec-stream") | |
brake = require("brake") | |
file = fs.createWriteStream("tmp.txt") |
I hereby claim:
- I am codelenny on github.
- I am codelenny (https://keybase.io/codelenny) on keybase.
- I have a public key ASCNDhBbNEXs76GUdb2Pz6y7Q1TflbkkWeotSuIjW3oi_Qo
To claim this, I am signing this object:
NewerOlder