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 ruby | |
# | |
# This is a small script to transcode a directory of media files | |
# with ffmpeg. | |
require 'fileutils' | |
# These are config values are for my project. Swap in your own. | |
input_dir="/Volumes/severn.5/video" | |
output_dir="/Volumes/severn.4/video/transcoded" |
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
from random import random | |
from dogapi import dog_stats_api | |
dog_stats_api.start(statsd=True, | |
statsd_host='localhost', | |
statsd_port=8125) | |
while True: | |
dog_stats_api.gauge('test.udp.gauge', 1000) |
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 CoffeeScript compiles to ... | |
x = if 'a' in [1, 2, 3, 4] | |
1 | |
else if 'b' in [1, 2, 3, 4, 5] | |
2 | |
else if 'c' > 'd' | |
3 | |
else |
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
$(document).ready -> | |
onHoverStart = -> | |
$(this).animate({backgroundColor:'#7c9344'},'fast') | |
onHoverEnd = -> | |
$(this).animate({backgroundColor:'#7c9344'},'fast') | |
$('#menu li a').hover(onHoverStart, onHoverEnd) |
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 totals = _.reduce(results, function (memo, result) { | |
var curScore = memo[result.measure] || 0; | |
curScore += result.score; | |
memo[result.measure] = curScore; | |
return memo; | |
}, {}); |
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 | |
var fs = require('fs'); | |
var path = require('path'); | |
var CoffeeScript = require('coffee-script'); | |
var file = process.argv[2]; | |
var source = fs.readFileSync(file).toString() | |
var tokens = CoffeeScript.tokens(source); |
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 module demonstrates the functionality | |
of the fileutils library. | |
http://github.com/clutchski/fileutils | |
""" | |
import fileutils | |
# |
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 Caribou migration demonstrating an interface for database agnostic migrations | |
that doesn't force how you connect to the database. | |
""" | |
def upgrade(connector): | |
# a connector can give you a plain old db api connection | |
conn = connector.connect() | |
conn.execute("create table my_table ...") |
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
""" | |
an example illustrating how to run a caribou migration | |
""" | |
import caribou | |
db_path = '/path/to/db.sqlite3' | |
migrations_path = '/path/to/migrations/dir' | |
version = '20091114132332' |
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
""" | |
an example of a caribou migration | |
""" | |
def upgrade(connection): | |
sql = """ | |
create table animals | |
( name TEXT | |
, status TEXT | |
) """ |
NewerOlder