- Maintain my eating habits.
- Release ZenIRCBot 3.0.
- Maintain 4 bugs per week for work.
- 30-60 minutes of non commute walking/running/cycling 4 days a week.
- 1 blog post a week for each of the following areas: tech, food, life.
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
import csv | |
class SlugCSVWriter(object): | |
""" A CSV DictWriter that takes an OrderedDict for fieldnames. | |
The purpose of using an OrderedDict allows you to use a slug or | |
other unique value in your dictionary, but use non-unique names | |
for your fields. | |
""" |
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 NameModel(models.Model): | |
name = models.CharField() | |
other = models.ForeignKey('OtherModel') | |
class OtherModel(models.Model): | |
count = models.IntegerField | |
@property | |
def all_my_names(self): |
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
def is_odd(num): | |
return bool(num % 2) | |
def test_is_odd(): | |
assert_equal(is_odd(3), True) | |
assert_equal(is_odd(4), False) |
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
{ | |
"success": true, | |
"graph_data": { | |
"<surveyor_name>": [{ | |
"timestamp": "<truncated_timestamp>", | |
"count": <count> | |
}] | |
} | |
} |
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
{ | |
"ignore": ["E501", "E128"] | |
} |
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 net = require('net') | |
, duplexer = require('duplexer') | |
, through = require('through') | |
net.createServer(function(c) { | |
c.pipe(connection()).pipe(c) | |
}).listen(6668) | |
function connection() { | |
var socket = new net.Socket() |
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 winston = require('winston') | |
, path = require('path') | |
winston.add(winston.transports.File)({filename: 'zenircbot.log'}) | |
function get_logger(file) { | |
var process_dir = path.dirname(process.argv[1]) | |
, filename = path.relative(process_dir, __filename) | |
, logger = {} |
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/sh | |
BRANCH=`git rev-parse --abbrev-ref HEAD` | |
REMOTES=`git remote -v | awk '{print $2}' | uniq | sort` | |
if [ $# != 1 ] | |
then | |
echo 'Syntax: githubify <path_to_file>' | |
exit 1 | |
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
Host *.lxc | |
StrictHostKeyChecking no | |
UserKnownHostsFile /dev/null | |
ProxyCommand nc $(host -N0 $(echo %h | sed "s/\.lxc//g") 10.0.3.1 | tail -1 | awk '{print $NF}') %p | |
User ubuntu |