Skip to content

Instantly share code, notes, and snippets.

View wavded's full-sized avatar
🐢
Turtles all the way

Marc Harter wavded

🐢
Turtles all the way
View GitHub Profile
exports.bufferOrderFile = function (req) {
const d = exports.createDeferred()
var name
const data = []
// Capture errors but intentially resolve to undefined
const captureErAndRes = er => { log.err(er); d.resolve() }
try {
{"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]}
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 / test.json
Created August 14, 2012 17:06
Test
[ { "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?" }
Handle<Value> Method(const Arguments &args) {
HandleScope scope;
return scope.Close(Undefined());
}
// are these doing the same thing?
Handle<Value> Method(const Arguments &args) {
HandleScope scope;
}
void Socket::Init(Handle<Object> target) {
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
t->SetClassName(String::NewSymbol("Socket"));
t->InstanceTemplate()->SetInternalFieldCount(1);
t->InstanceTemplate()->SetAccessor(String::NewSymbol("state"), GetState, NULL);
SetPrototypeMethod(t, "bind", Bind);
SetPrototypeMethod(t, "bindSync", BindSync);
var cookie = require('cookie')
var connectUtils = require('connect').utils
// ----
io.set('authorization', function (data, ack) {
var cookies = cookie.parse(data.headers.cookie)
var signedCookies = connectUtils.parseSignedCookies(cookies, 'YOUR SECRET')
redisSession.get(signedCookies['connect.sid'], function (err, sess) {
data.session = sess
@wavded
wavded / blamda.js
Created January 25, 2012 18:55
block-lambda would be nice
var OrderManager = {
getRecordById: function (id) {
function gridCheck (TypeOrder) {
if (TypeOrder != null) {
var record = TypeOrder.getGrid().store.getById(id)
if (record) {
return { // would like the parent function to exit here (but ain't gonna happen)
record: record,
grid: TypeOrder.getGrid()
@wavded
wavded / gotchas.coffee
Created January 24, 2012 04:02
CoffeeScript gotchas
# Overall I like CoffeeScript, but these have bitten me.
# 1.
if cat is not "fluffy" # means if cat is false
# 2.
a = i for i in [1,2,3] # 3
b =
c: i for i in [1,2,3] # [1,2,3]
@wavded
wavded / .gitignore
Created January 11, 2012 18:29
.gitignore for checked in modules in npm
node_modules/**/build
node_modules/**/out
node_modules/**/.lock-wscript
npm_debug.log