Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
require 'eventmachine'
require 'delegate'
module TransactionProtocol
class Writer < EM::Queue
class << self
@files = []
attr_accessor :files
end
define perl_backtrace_5_10_unthreaded
set $si = (struct stackinfo*)PL_curstackinfo
while $si
printf "struct stackinfo * 0x%x {\n", (int)$si
set $cx = (PERL_CONTEXT*)($si->si_cxstack)
printf " PERL_CONTEXT * 0x%x\n", (int)$cx
set $cxix = (int)($si->si_cxix)
printf " int cxix %d\n", $cxix
#!/usr/bin/perl4
# Horrible, horrible, horrible edit of someone's
# even more horrible "reddit clone in 4 lines of perl".
use CGI ':standard';
$dir = File::Basename::dirname( $0 );
chdir $dir;
require 'tempfile'
require 'dl'
class Carp
@@in_gdb_bt = false
def initialize
bt = []
if ! @@in_gdb_bt
@@in_gdb_bt = true
perl -Mwarnings -le 'print for keys %warnings::Offsets'\
| xargs -n1 perl -Mwarnings -e '
BEGIN {
$SIG{__WARN__} = sub { $W = 1 };
warnings->unimport( $ARGV[0] )
}
print "foo" if my $x = 0E0;
END { print $ARGV[0] if ! $W } '
# syntax