Skip to content

Instantly share code, notes, and snippets.

View stackptr's full-sized avatar

✿ corey stackptr

View GitHub Profile
@stackptr
stackptr / lessthan3.js
Created September 8, 2014 22:08
LessThan3 programming challenge
// Compare function for sort:
// Move 'jack' forward first, then 'jill' if no 'jack'; leave other values unsorted
function compare(a, b){
if (a === 'jack'){
return -1;
} else if (b === 'jack') {
return 1;
} else if (a === 'jill') {
return -1;
} else if (b === 'jill') {
@stackptr
stackptr / gist:9966167
Created April 4, 2014 01:16
keybase.md
### Keybase proof
I hereby claim:
* I am stackptr on github.
* I am mu (https://keybase.io/mu) on keybase.
* I have a public key whose fingerprint is 5AEA 8B12 0FA1 AC7E 85B3 7A66 CD98 C2EE 053F E0BA
To claim this, I am signing this object:
@stackptr
stackptr / gist:9019802
Created February 15, 2014 14:14
readline test
var rl = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
function Point(x, y){
this.x = x;
this.y = y;
}
var graph = {
rows: []
}
graph.readLine = function(line){
if (line == "") return;
this.rows.push(line);
}