This file contains hidden or 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
function* fibGen (current, next) { | |
yield current | |
yield* fibGen(next, current + next) | |
} | |
for (var num of fibGen(0,1)); | |
// function* fibGen (current, next) { | |
// ^ | |
// RangeError: Maximum call stack size exceeded |
This file contains hidden or 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
JPEG / No Imagery / Fresh Cache | |
250000 - 196.5k | |
150000 - 212.8k | |
100000 - 1.2m | |
80000 - 1.2m | |
50000 - 1m | |
35000 - 831.1k | |
32000 - 735.1k | |
25000 - 772.8k |
This file contains hidden or 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
# A makeshift SMTP server that logs all messages to the console | |
python -m smtpd -n -c DebuggingServer localhost:25 | |
# Spotlight search results in terminal | |
mdfind |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
// works | |
var fs = require('fs'), | |
spawn = require('child_process').spawn, | |
out = fs.openSync('./out.log', 'a'), | |
err = fs.openSync('./out.log', 'a'); | |
var child = spawn('prg', [], { | |
detached: true, | |
stdio: [ 'ignore', out, err ] | |
}); |
This file contains hidden or 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
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
tar xvf phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
sudo mv phantomjs-1.9.1-linux-x86_64 /usr/local/lib/phantomjs | |
sudo ln -s /usr/local/lib/phantomjs/bin/phantomjs /usr/local/bin/phantomjs |
This file contains hidden or 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
function map (arr, func) { | |
return Promise.resolve().then(function () { | |
return arr.map(function (el) { return func(el) }) | |
}).all() | |
} | |
function mapSeries (arr, func) { | |
let currentPromise = Promise.resolve() | |
let promises = arr.map(function (el) { | |
return currentPromise = currentPromise.then(function () { |
This file contains hidden or 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
var fs = require('fs') | |
var Q = require('q') | |
var fs_stat = Q.denodeify(fs.stat) | |
var files = ['./fixtures/file1', './fixtures/file2', './fixtures/file3'] | |
function getStatsSeries (files) { | |
var d = Q.defer() | |
var results = [] | |
files.reduce(function (last, file) { |
This file contains hidden or 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
"use strict" | |
var Promise = function () { | |
this.state = 'pending' | |
this.thenables = [] | |
} | |
Promise.prototype.resolve = function (value) { | |
if (this.state != 'pending') return | |
this.state = 'fulfilled' |
This file contains hidden or 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
{"baseURL":"http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/$%7Bz%7D/$%7By%7D/$%7Bx%7D","opacity":1,"singleTile":false,"type":"XYZ","maxExtent":[-20037508,-20037508,20037508,20037508.34],"tileSize":[256,256],"extension":"%7D","resolutions":[156543.0339,78271.51695,39135.758475,19567.8792375,9783.93961875,4891.969809375,2445.9849046875,1222.99245234375,611.496226171875,305.7481130859375,152.87405654296876,76.43702827148438,38.21851413574219,19.109257067871095,9.554628533935547,4.777314266967774,2.388657133483887,1.1943285667419434,0.5971642833709717,0.29858214168548586,0.14929107084274293,0.07464553542137146]} |