Skip to content

Instantly share code, notes, and snippets.

View daniel-beard's full-sized avatar

Daniel Beard daniel-beard

View GitHub Profile
@nkuln
nkuln / cxa_throw_replace_backtrace.c
Created March 12, 2012 09:18
Override __cxa_throw and prints backtrace when exception is thrown (Linux)
#include <dlfcn.h>
#include <execinfo.h>
typedef void (*cxa_throw_type)(void *, void *, void (*) (void *));
cxa_throw_type orig_cxa_throw = 0;
void load_orig_throw_code()
{
orig_cxa_throw = (cxa_throw_type) dlsym(RTLD_NEXT, "__cxa_throw");
}
@jpr5
jpr5 / bot.rb
Created April 26, 2011 07:13
XMPP/Ruby Bot for HipChat
#!/usr/bin/env ruby
#
# Script: HipChat bot in Ruby
# Author: Jordan Ritter <jpr5@darkridge.com>
#
unless `rvm-prompt i g`.chomp == "ree@xmpp"
exec("rvm ree@xmpp ruby #{$0}")
end