Skip to content

Instantly share code, notes, and snippets.

🐢
Turtles all the way

Marc Harter wavded

🐢
Turtles all the way
Block or report user

Report or block wavded

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test-single.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:6450827
// 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 ]
});
@wavded
wavded / setup.sh
Created Jul 31, 2013
Ubuntu PhantomJS Setup
View setup.sh
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
View async-to-q.js
var fs = require('fs')
var Q = require('q')
var fs_stat = Q.denodeify(fs.stat)
var fs_readdir = Q.denodeify(fs.readdir)
var files = [
'./fixtures/file1',
'./fixtures/file2',
'./fixtures/file3',
'./fixtures/file4'
View series.js
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) {
@wavded
wavded / promise.js
Last active Sep 6, 2019
Promise A+ Implementation
View promise.js
"use strict"
var Promise = function () {
this.state = 'pending'
this.thenables = []
}
Promise.prototype.resolve = function (value) {
if (this.state != 'pending') return
this.state = 'fulfilled'
View gist:3912550
{"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]}
View gist:3453287
awk 'match($0, "layouts:") == 1 { print $0 }' test.yaml | wc -l
sed '/layouts:/ i\ - !dnsMatch\n host: HI THERE\n' test.yaml | head -n 100
@wavded
wavded / gist:3373385
Created Aug 16, 2012
/etc/locale.conf
View gist:3373385
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
View test.json
[ { "name": "Marc"
, "quote": "Intern! My cube needs to be GC'ed!" }
, { "name": "George Carlson"
, "quote": "I don't read documentation, I just try random parameters..." }
, { "name": "Jon Kelly"
, "quote": "Sometimes a man needs a lot of chips" }
, { "name": "Myles Steinhauser"
, "quote": "I start with the toilet first" }
, { "name": "Kathy Nelson"
, "quote": "I googled you, didn't you get my google?" }
You can’t perform that action at this time.