{{ message }}

Instantly share code, notes, and snippets.

# Billie Hilton wmhilton

Last active Aug 29, 2015 — forked from NPashaP/.block
UI for editing tree graph structures
View index.html
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

Last active Aug 29, 2015
Simple Express Parameter Parsing Demo
View Express Parameter Parsing Demo.md

# Simple Express Parameter Parsing Demo

1. git clone https://gist.github.com/a5656b01c35d6f25dda7.git demo
2. cd demo
3. npm install
4. npm start

Look at the purty code. See how the magic be done.

Created Feb 14, 2015
View world-110m.js
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
 /* Straight stolen from http://bl.ocks.org/dwtkns/4686432 */ window.worlddata = {"type":"Topology","transform":{"scale":[0.03600360036003601,0.017366249624962495],"translate":[-180,-90]},"objects":{"land":{"type":"MultiPolygon","arcs":[[[0]],[[1]],[[2]],[[3]],[[4]],[[5]],[[6]],[[7,8]],[[9,10]],[[11]],[[12]],[[13]],[[14]],[[15]],[[16]],[[17]],[[18]],[[19]],[[20]],[[21]],[[22]],[[23]],[[24]],[[25]],[[26]],[[27]],[[28,29]],[[30]],[[31]],[[32]],[[33]],[[34]],[[35]],[[36]],[[37]],[[38]],[[39]],[[40]],[[41,42]],[[43]],[[44]],[[45]],[[46,47,48,49]],[[50]],[[51]],[[52]],[[53]],[[54]],[[55]],[[56]],[[57]],[[58]],[[59]],[[60]],[[61,62]],[[63]],[[64]],[[65]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75,76]],[[77]],[[78]],[[79]],[[80]],[[81]],[[82]],[[83]],[[84]],[[85]],[[86]],[[87]],[[88]],[[89,90]],[[91]],[[92]],[[93]],[[94]],[[95]],[[96]],[[97]],[[98]],[[99]],[[100]],[[101]],[[102]],[[103]],[[104]],[[105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,
Created Nov 9, 2015 — forked from KyleGobel/upsert.sql
Insert/Update Upsert Trigger in Postgres
View upsert.sql
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
 CREATE OR REPLACE FUNCTION upsert_user() RETURNS trigger AS $upsert_user$ declare existing record; begin if (select EXISTS(select 1 from users where user_id = NEW.user_id)) then select user_name, user_class, user_age into strict existing from users where user_id = new.user_id;
Created Jan 20, 2013 — forked from cscorley/example.tex
View example.tex
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
 \documentclass{jhwhw} \author{Christopher S. Corley} \title{Class homework solutions} \date{October 19, 2011} \begin{document} \problem{Some problem name} blahblah \solution
Last active Dec 18, 2015
Dict Object for JavaScript
View Dict.js
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
 /* * Dict Object for JavaScript (https://gist.github.com/wmhilton/5859079) * Author: William Hilton (wmhilton@gmail.com) * License: http://opensource.org/licenses/MIT * * Say you want something like a Python "dictionary" or a Java "map" where you * are storing (String key, Object value) pairs. It's tempting to do it using * object properties in JavaScript, since * obj['key'] = value * works so conveniently. However, say you want to be able to have some properties
Created Jul 3, 2013 — forked from isaacs/comma-first-var.js
View comma-first-var.js
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
 // See comments below. // This code sample and justification brought to you by // Isaac Z. Schlueter, aka isaacs // standard style var a = "ape", b = "bat", c = "cat", d = "dog",
Created Jan 14, 2016
A huge collection of Bash utility functions. Could come in handy!
View util.bash
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
 #!/bin/bash -e # Author: gdbtek (Nam Nguyen) # Repo: https://github.com/gdbtek/ubuntu-cookbooks # License: MIT ################### # ARRAY UTILITIES # ################### function arrayToString()
Last active Feb 25, 2016
Thoughts on a Universal Data schema
View random_thoughts.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
 // TODO: Clean up thoughts into a nice document. // Thoughts on Universal Data language / description // See: https://martin.kleppmann.com/2012/12/05/schema-evolution-in-avro-protocol-buffers-thrift.html#comment-2534873305 /* Preface: Why do Thrift, Protobuf, and Avro each define their own IDL? I would think that there could be an implementation-independent "master" IDL to standardize the syntax (the semantics depends on the feature set of the implementation). It makes it hard to try out these different libraries when they require rewriting the message schema each time.
Created May 6, 2016
Mocha users need to watch out for this surprising behavior