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
[user] | |
name = Zack Dever | |
email = [email protected] | |
[github] | |
user = zever | |
[core] | |
editor = vim | |
excludesfile = /Users/dp/.gitignore_global | |
[help] | |
autocorrect = -1 |
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
# credit: http://stackoverflow.com/a/7849648/962091 | |
git filter-branch --index-filter "git rm -r -f --cached --ignore-unmatch unwanted-dir/*" --prune-empty -- --all |
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 http = require('http'); | |
var fs = require('fs'); | |
var helloModuleString = "exports.world = function() { return 'Hello World\\n'; }"; | |
fs.writeFile('./hello.js', helloModuleString, function (err) { | |
if (err) return console.log(err); | |
var hello = require('./hello'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); |
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
// this isn't all the possible valid periods, but it's a good batch | |
var periods = [] | |
, seed = ['pm', 'p', 'p.m.', 'pm.', 'p.m']; | |
for (var i=0; i<seed.length; i++) { | |
var s = seed[i]; | |
periods.push(s); | |
periods.push(s.toUpperCase()); | |
periods.push(s.replace('m', 'M')); | |
periods.push(s.replace('p', 'P')); |
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
# credit http://stackoverflow.com/a/1920585/962091 | |
# sorts keys and pretty prints | |
echo '{"foo": "lorem", "bar": "ipsum"}' | python -mjson.tool |
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
String::endswith = (str) -> @match new RegExp "#{str}$" | |
String::startswith = (str) -> @match new RegExp "^#{str}" | |
String::splitLines = () -> @split /\r\n|\r|\n/ | |
# not unlike jQuery.extend. | |
# adds new properties in object to target. | |
# does not override anything any target properties. | |
# TODO: test! | |
exports.extend = (target, object) -> |
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
class StateMachine(object): | |
"""the brain - manages states""" | |
def __init__(self): | |
self.states = {} | |
self.active_state = None | |
def add_state(self, state): | |
"""Adds a new state""" | |
self.states[state.name] = state |
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 bgImgs = [ | |
'/images/foo.png' | |
, '/images/bar.png' | |
, '/images/foobar.png' | |
]; | |
$(function () { | |
if (bgImgs.length > 1) { | |
var bgImage = $('#bgImage') | |
, index = 0 |
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
alias arcpaste='arc paste | copyarcpaste' |
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
// http://stackoverflow.com/a/13472375/962091 | |
// may also need to make room on the chart itself, maybe something like: | |
// chart.margin({left: 10}); | |
d3.select('.nv-y.nv-axis > g').selectAll('g'); |