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
var Maze = (function () { | |
// Fisher-Yates shuffle: | |
function shuffle_list(l) { | |
for(var i=l.length-1; i>0; i--) { | |
var j = Math.floor(Math.random() * (i+1)); | |
var temp = l[i]; | |
l[i] = l[j]; | |
l[j] = temp; | |
} |
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
var jinx = require('jinx'); | |
var DELIVERY = 1024; | |
var DELIVERIES = 60; | |
function choice(l) { return l[Math.floor(Math.random() * l.length)]; } | |
function cupcake() { return ["cC", "uU", "pP", "cC", "aA4", "kK", "eE3"].map(choice).join(""); } | |
jinx.get("^/cupcake$", function (req, res, next) { | |
var left = DELIVERIES; |
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
var urllib = require('url'); | |
var VALID_PARAM = /^[a-z0-9_]+$/i; | |
var ACTIONS = [ | |
{ name: "index", verb:"get", path: "" }, | |
{ name: "new", verb:"get", path: "/new" }, | |
{ name: "create", verb:"post", path: "" }, | |
{ name: "show", verb:"get", path: "/:param" }, | |
{ name: "edit", verb:"get", path: "/:param/edit" }, |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include "linebuffer.h" | |
#define LINE_BUFFER_LENGTH 1024 | |
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
var E_PREFIX_RATE = 0.25; | |
// All of our word lists: | |
var _word_lists = { | |
verb : [ | |
"implement", "utilize", "integrate", "streamline", "optimize", "evolve", "transform", "embrace", | |
"enable", "orchestrate", "leverage", "reinvent", "aggregate", "architect", "enhance", "incentivize", | |
"morph", "empower", "envisioneer", "monetize", "harness", "facilitate", "seize", "disintermediate", |
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
State WalMart Retail Units 2013 Population People / Walmart | |
ALABAMA 121 4833722 39948.116 | |
ALASKA 13 735132 56548.615 | |
ARIZONA 121 6626624 54765.488 | |
ARKANSAS 107 2959373 27657.692 | |
CALIFORNIA 282 38332521 135930.926 | |
COLORADO 100 5268367 52683.670 | |
CONNECTICUT 39 3596080 92207.179 | |
DELAWARE 10 925749 92574.900 | |
FLORIDA 317 19552860 61680.946 |
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
var dgram = require('dgram'); | |
function Timer() { | |
this.st = Date.now(); | |
} | |
Timer.prototype.poll = function poll(name) { | |
var now = Date.now(); | |
console.log("%s :: %d", (name || "--"), (now - this.st)); | |
this.st = now; |
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
function _test(cb) { | |
var file_line = new Error().stack.split(/\n/g)[2].trim(); | |
var start = Date.now(); | |
return function () { | |
console.log("%d :: %s", (Date.now() - start)/1000, file_line); | |
cb.apply(null, arguments); | |
} | |
} |
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 | |
export LOL="() { true; }; echo 'this was just executed as the current user, oh no'" | |
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 | |
# Will take in a file, with URLs on different lines, and will perform a HEAD request for | |
# each one, printing HTTP status code along with content length. | |
if [ $# -ne 1 ] ; then | |
echo "Usage: bash $0 <file_with_urls>" | |
exit 1 | |
fi |
OlderNewer