Skip to content

Instantly share code, notes, and snippets.

View amackera's full-sized avatar
💭
Hack and /

Anson MacKeracher amackera

💭
Hack and /
View GitHub Profile
@amackera
amackera / gist:3845274
Created October 6, 2012 15:47
harakiri
*** HARAKIRI ON WORKER 8 (pid: 32233) ***
HARAKIRI: -- wchan> sk_wait_data
*** backtrace of 32233 ***
/usr/local/bin/uwsgi(uwsgi_backtrace+0x29) [0x807ff59]
/usr/local/bin/uwsgi(what_i_am_doing+0x21) [0x80804b1]
[0xb7873400]
/usr/lib/libpython2.6.so.1.0(+0x1283c6) [0xb75ca3c6]
/usr/lib/libpython2.6.so.1.0(PyCFunction_Call+0x112) [0xb7513c92]
/usr/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x49fe) [0xb757445e]
/usr/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x59c1) [0xb7575421]
@amackera
amackera / Procfile
Created October 2, 2012 14:17
Foreman Procfile and supporting scripts
rabbitmq: rabbitmq-server
pushy: pushy
mongodb: mongodb
pingpong: pingpong
cottontail: cottontail
@amackera
amackera / gist:3777540
Created September 24, 2012 18:39
Breakage
SELECT `edumacation_thmlog`.`id`, `edumacation_thmlog`.`user_id`, `edumacation_thmlog`.`message`, `edumacation_thmlog`.`created_at`, `edumacation_thmlog`.`type`, `edumacation_thmlog`.`severity`,
`edumacation_thmlog`.`use_sentry`, `statsconsole_eventlog`.`thmlog_ptr_id`, `statsconsole_eventlog`.`action`, `statsconsole_eventlog`.`course_id`,
`statsconsole_eventlog`.`related_object` FROM `statsconsole_eventlog` INNER JOIN `edumacation_thmlog` ON (`statsconsole_eventlog`.`thmlog_ptr_id` = `edumacation_thmlog`.`id`) WHERE
(`statsconsole_eventlog`.`action` = 'exception' AND `edumacation_thmlog`.`created_at` >= '2009-12-30 18:27:21' ) ORDER BY `edumacation_thmlog`.`created_at` DESC
@amackera
amackera / gist:3752753
Created September 19, 2012 22:30
Facepalm
............................................________
....................................,.-'"...................``~.,
.............................,.-"..................................."-.,
.........................,/...............................................":,
.....................,?......................................................,
.................../...........................................................,}
................./......................................................,:`^`..}
.............../...................................................,:"........./
..............?.....__.........................................:`.........../
............./__.(....."~-,_..............................,:`........../
@amackera
amackera / .zshrc
Created September 12, 2012 23:49
My .zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="afowler"
# Example aliases
@amackera
amackera / gist:2239640
Created March 29, 2012 16:40
get_outgoing_number
def get_outgoing_number(provider, incoming_number):
'''
Returns the outgoing number associated with this incoming number.
'''
def get_sms_settings():
# Memcached closure returns outgoing number for this student
try:
settings = SmsSettings.objects.get(phone_number = incoming_number)
except SmsSettings.DoesNotExist:
# Create settings record for this number
@amackera
amackera / .bashrc
Created September 25, 2010 19:57 — forked from henrik/.bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"