Skip to content

Instantly share code, notes, and snippets.

@sebm
sebm / index.html
Created March 29, 2012 07:28
How to get JSONP working cross domain
<!DOCTYPE html>
<html>
<head>
<title>JSONP test</title>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
</head>
<body>
<script>
var named_callback = function() {
console.log('whoo it worked')
@sebm
sebm / codecs.txt
Created January 20, 2012 21:35
All the codecs supported by ffmpeg
# From ffmpeg -codecs > codecs.txt
Codecs:
D..... = Decoding supported
.E.... = Encoding supported
..V... = Video codec
..A... = Audio codec
..S... = Subtitle codec
...S.. = Supports draw_horiz_band
@sebm
sebm / .gvimrc.after
Created December 13, 2011 04:32
My Vim dotfiles, used with Janus
color ir_black
set gfn=Consolas:h15
@sebm
sebm / convert_mp3s_to_oggs.sh
Created October 3, 2011 21:13
A shell command to convert all .mp3 files in a directory into .ogg files
find . -name "*.mp3" -type f -exec ffmpeg -i {} -acodec libvorbis -aq 30 {}.ogg \;
@sebm
sebm / gist:1224202
Created September 17, 2011 18:26
My error log from trying to install Erlang via homebrew
... redacted ...
/usr/bin/llvm-gcc -m64 -O3 -march=core2 -w -pipe -I/private/tmp/homebrew-erlang-R14B03-5PBu/erlang-otp-e416814/erts/i386-apple-darwin10.8.0 -no-cpp-precomp -D_XOPEN_SOURCE -DHAVE_CONFIG_H -O2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -I/private/tmp/homebrew-erlang-R14B03-5PBu/erlang-otp-e416814/erts/include -I/private/tmp/homebrew-erlang-R14B03-5PBu/erlang-otp-e416814/erts/include/i386-apple-darwin10.8.0 -I/private/tmp/homebrew-erlang-R14B03-5PBu/erlang-otp-e416814/erts/include/internal -I/private/tmp/homebrew-erlang-R14B03-5PBu/erlang-otp-e416814/erts/include/internal/i386-apple-darwin10.8.0 -DEPMD_PORT_NO=4369 -o /private/tmp/homebrew-erlang-R14B03-5PBu/erlang-otp-e416814/erts/obj/i386-apple-darwin10.8.0/epmd.o -c epmd.c
/usr/bin/llvm-gcc -m64 -O3 -march=core2 -w -pipe -I/private/tmp/homebrew-erlang-R14B03-5PBu/erlang-otp-e416814/erts/i386-apple-darwin10.8.0 -no-cpp-precomp -D_XOPEN_SOURCE -DHAVE_CONFIG_H -O2 -Wall -Wstrict-prototypes -Wmissing-proto
@sebm
sebm / twittycity-cached-chart.js
Created August 26, 2011 09:52
Twitty City example cached chart data
data.addRows([
[new Date(2011, 7, 26, 8, 46), 2.54814814815, undefined, undefined, undefined, undefined],
[new Date(2011, 7, 26, 8, 41), 2.52, undefined, undefined, undefined, undefined],
[new Date(2011, 7, 26, 8, 36), 2.49333333333, undefined, undefined, undefined, undefined],
[new Date(2011, 7, 26, 8, 31), 2.49696969697, undefined, undefined, undefined, undefined],
[new Date(2011, 7, 26, 8, 26), 2.46666666667, undefined, undefined, undefined, undefined],
[new Date(2011, 7, 26, 8, 21), 2.5037037037, undefined, undefined, undefined, undefined],
[new Date(2011, 7, 26, 8, 16), 2.56296296296, undefined, undefined, undefined, undefined],
[new Date(2011, 7, 26, 8, 11), 2.54814814815, undefined, undefined, undefined, undefined],
[new Date(2011, 7, 26, 8, 6), 2.45, undefined, undefined, undefined, undefined],
@sebm
sebm / error log
Created June 29, 2011 22:37
A problem I'm encountering deleting embedded documents using Mongoose
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object #<Object> has no method 'remove'
at /Users/sebastian/japes/mongotest/mongotest.js:34:22
at /Users/sebastian/japes/mongotest/node_modules/mongoose/lib/mongoose/query.js:660:22
at model.init (/Users/sebastian/japes/mongotest/node_modules/mongoose/lib/mongoose/document.js:147:5)
at /Users/sebastian/japes/mongotest/node_modules/mongoose/lib/mongoose/query.js:658:16
at /Users/sebastian/japes/mongotest/node_modules/mongoose/support/node-mongodb-native/lib/mongodb/cursor.js:130:9
at /Users/sebastian/japes/mongotest/node_modules/mongoose/support/node-mongodb-native/lib/mongodb/cursor.js:176:11
@sebm
sebm / header.php
Created June 1, 2011 22:36
Customize WordPress's TwentyTen theme for Google +1.
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
@sebm
sebm / gist:992881
Created May 26, 2011 10:10
Add a GitX symlink to /usr/local/bin
ln -s /Applications/GitX.app/Contents/Resources/gitx /usr/local/bin/gitx
@sebm
sebm / howold.py
Created May 22, 2011 22:01
Python script for printing time elapsed since stuff
#!/usr/bin/env python
from datetime import date
def how_long_between(dayA, dayB):
total_days = (dayA - dayB).days
years = total_days / 365
days = total_days % 365
months = days / 31