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
holman/dotfiles: | |
PR:91 dplarson -- Replace empty echo's with printf new line | |
#91: Replace empty echo's with printf new line | |
dplarson commented on issue 91: Makes sense. | |
bestiejs/benchmark.js: | |
#45: Newbie question |
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 | |
JS_FILES=$(find "$1" -name "*.js") | |
for FILE in $JS_FILES; do | |
short_name=`basename $FILE` | |
filename="${short_name%.*}" | |
git grep --quiet $filename 1>/dev/null | |
if [ "$?" == "1" ]; then | |
echo "Should delete: $FILE" |
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
package main | |
import ( | |
"encoding/json" | |
"errors" | |
"fmt" | |
"html" | |
"log" | |
"net/http" | |
) |
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
#!/usr/bin/env node | |
/** | |
* Transforms code from old-style requirejs modules into AMD sugared modules. | |
* | |
* define(['dep1','dep2'], function(arg1, arg2) {...}) | |
* | |
* becomes: | |
* | |
* define(function(require) { var arg1 = require('dep1'), arg2 = require('dep2'); ... }); | |
* |
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 lint = require('jsl') | |
, linter = lint(); | |
linter.rule('variable > id', | |
function (node, subsource, alert) { | |
var var_name = node.name; | |
if (var_name.indexOf("_") !== -1) { | |
alert(node, 'Found variable name with underscores: ' + var_name); | |
} | |
}, 'error'); |
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
#!/usr/bin/env node | |
/* | |
* We have trailing underscores on variables to indicate | |
* private. That's silly. Preceeding underscores are the only obvious | |
* choice. | |
* | |
* var foo = function () { | |
* this.bar_ = '9'; | |
* _.bindAll(this, 'foo_'); | |
* } |
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
VENV_DIR=`md5sum requirements/* | md5sum 2>&1 | awk '{print $1}'` | |
if [ -e $VENV_DIR ]; then | |
. /tmp/$VENV_DIR/bin/activate | |
else | |
virtualenv --no-site-packages /tmp/$VENV_DIR | |
. /tmp/$VENV_DIR/bin/activate | |
pip install --download-cache /var/lib/jenkins/.pip_download_cache -r requirements/ci.txt | |
fi |
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
/* | |
goals: | |
middleware, like express. | |
no `.next()`, which express has. | |
use of promises (rejecting/resolving) unlike node's traditional (err, data) thing | |
immutable requests, preferring instead an explicit databag for state managment (continuous local storage) | |
"composable after the routing method" |
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
I really want a service where you can enter in 2 wikipedia pages and | |
it will tell you how they relate. It'd be especially cool if someone | |
else made it, so I'm writing up how I think it might be done in | |
Python. | |
Due to the nature of the queries you want to do (how does x relate to | |
y), I think this should end up in a graph database. In this graph | |
database, every page is a node. Links between pages are directed edges | |
in the graph, annotated with the paragraph of text they're linked | |
from. |
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
/** | |
* A proxy for loading static files in development. Django doesn't handle this well. | |
* | |
* To run, do something like: | |
* npm install . | |
* node proxy.js --docroot=$PWD | |
* | |
* Then just visit http://localhost:9000/ as you normally would. | |
*/ | |
var httpProxy = require('http-proxy'); |