Skip to content

Instantly share code, notes, and snippets.

View stouset's full-sized avatar

Stephen Touset stouset

View GitHub Profile
class Name
CONSTANT_1 = :a
CONSTANT_2 = :b
include Module
attr_accessor :accessor1
attr_accessor :accessor2
def self.method(*args)
%;';;X= %q(x=1; z="%c"%
32;eval %w(w=N= Merry =128;r=
z*79+$/; ;p=open" / dev/dsp
","w"rescue$_;/ / ;eval"s
rand(%s)"%$*[ d=0];a=[];s=(r+z+% (%;';;X=#{z* 3}%q(#{X});e val(X))
+r*=23).l ines.map{|l|l.chop+ r};t=proc{|y|s [y][x-1,w].sca n(/\S
/){s[y+1][m=x -1+$` .size ,1]== z&&a< <[$&,m, y,s[y
][m]=$/]};y};t[ 23];f =(0.. 1071) .map{|i|c,x,y =a.shuffle!. pop;s
[y][x]=z ;[794-46 .03*i **0.4 +y/k= (3+ra nd*w= 3)/9,[t
[t[y]-1 ],x,c], (0..y /k).m ap{[y -=k,0.5+x+=k*r and*2-k,?*]}]} ;"|ii
git checkout -b $new_branch_name $branch_you_did_the_changes_on # create a new branch with all the changes
git checkout $branch_you_did_the_changes_on # go back to the branch you did the work on
git stash -u # stash all your changes and any new files
git status # confirm a "clean" state
git reset --hard master # reset your branch back to being unchanged from `master`
git checkout master
git merge $new_branch_name # merge in the changes from the new branch
git checkout $branch_you_did_the_changes_on
git rebase master # fast-forward to the new state of master
git stash pop # bring all your changes back
diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am
index da5900e..f26576a 100644
--- a/src/libsodium/Makefile.am
+++ b/src/libsodium/Makefile.am
@@ -4,25 +4,32 @@ lib_LTLIBRARIES = \
libsodium_la_SOURCES = \
crypto_auth/crypto_auth.c \
+ crypto_auth/hmacsha256/auth_hmacsha256.c \
crypto_auth/hmacsha256/ref/api.h \
64 bytes from 98.234.232.1: icmp_seq=37 ttl=254 time=17.685 ms
Request timeout for icmp_seq 48
Request timeout for icmp_seq 49
Request timeout for icmp_seq 50
Request timeout for icmp_seq 51
Request timeout for icmp_seq 52
Request timeout for icmp_seq 53
Request timeout for icmp_seq 54
Request timeout for icmp_seq 55
Request timeout for icmp_seq 56
@stouset
stouset / gist:4540809
Created January 15, 2013 18:30
emacs-mac installation workaround
~ $ brew install --debug --HEAD emacs-mac
/usr/local/bin/brew: loading /usr/local/Library/Formula/emacs-mac.rb
/usr/local/Library/Formula/emacs-mac.rb: loading /usr/local/Library/Formula/python.rb
==> Cloning git://github.com/railwaycat/emacs-mac-port.git
Updating /Library/Caches/Homebrew/emacs-mac--git
==> ./configure --prefix=/usr/local/Cellar/emacs-mac/HEAD --without-dbus --enabl
==> make
cd /private/tmp/emacs-mac-r3ND && aclocal -I m4
/bin/sh: aclocal: command not found
make: *** [/private/tmp/emacs-mac-r3ND/aclocal.m4] Error 127
@stouset
stouset / stephen@touset.org
Created December 17, 2012 21:11
Generate a rainbow table of all possible SSNs

seq -f “%09.0f” 000000000 999999999 | sed -e ‘s/^\(.\{3\}\)\(.\{2\}\)\(.\{4\}\)/\1-\2-\3/’ | parallel -j16 –pipe ‘ruby -r digest/md5 -n -e “\$_.chomp!; puts "%s %s" % [\$_, Digest::MD5.hexdigest(\$_)]”’ > ssns

(setenv "PATH"
(concat (expand-file-name "~/.rbenv/shims:")
(expand-file-name "~/.rbenv/bin:")
(getenv "PATH")))
(setq exec-path
(append
(list (expand-file-name "~/.rbenv/shims")
(expand-file-name "~/.rbenv/bin"))
exec-path))
(setenv "PATH"
(concat (expand-file-name "~/.rbenv/shims:")
(expand-file-name "~/.rbenv/bin:")
(getenv "PATH")))
(setq exec-path
(append
(list (expand-file-name "~/.rbenv/shims")
(expand-file-name "~/.rbenv/bin"))
exec-path))
@stouset
stouset / gist:3305205
Created August 9, 2012 15:35
def_method_missing
class Foo
# regexp matchers yield the MatchData to the block, so you can modify the method
# body based on the regexp
def_method_missing /bar/ do |match|
-> { match.pre_match }
end
# without a regexp matcher, the name of the method is passed to the block, allowing
# you to decide whether or not to implement the method
def_method_missing do |name|