Skip to content

Instantly share code, notes, and snippets.

View adelcambre's full-sized avatar

Andy Delcambre adelcambre

View GitHub Profile
Module.new do
def prepend(m=nil, &blk)
if block_given?
super(Module.new(&blk))
else
super
end
end
end.tap { |pre| Module.prepend pre }
#!/bin/sh
#/ Usage: clean-merged-branches
#/ Delete locally merged branches
set -e
# show usage maybe
[ "$1" = "--help" ] && {
grep '^#/' <"$0"| cut -c4-
exit 0

Keybase proof

I hereby claim:

  • I am adelcambre on github.
  • I am adelcambre (https://keybase.io/adelcambre) on keybase.
  • I have a public key ASCGxdjSqDDqvE2BatODQroZBMmL2Ocy9p66NgPIdGAnjAo

To claim this, I am signing this object:

git config --global alias.lol "log '--pretty=format:%C(yellow)%h%Creset %cr %C(red)%d%Creset %s' --graph --decorate --branches"
@adelcambre
adelcambre / 00_tokyo.md
Last active August 29, 2015 14:06
Surviving tokyo

Some basics on Tokyo

Your phone should work

Just like in Europe. It's the same normal international data plan for most carriers (I've done it on At&t and Verizon).

Cash is king

And you get cash from 7-11 (yes I'm serious). American cards very very frequently don't work. Especially in any sort of machine, particularly vending machines and the train ticket machines. Many atm's won't take american cards either. But, every single 7-11 (which are everywhere) has an atm which takes american cards. They sometimes say 7-i, or Seven and i holdings. It's all the same thing (7-11 is actually a japanese company, and they are everywhere). Other than 7-11, every Post office should have an ATM that works too, but they are way less common.

@adelcambre
adelcambre / make_some_files.sh
Created September 3, 2014 20:52
Simple script to make lots of test files
for i in `seq 1000`; do
echo $i
touch $i
# or dd if=/dev/zero of=$i count=100 bs=1m
done

Keybase proof

I hereby claim:

  • I am adelcambre on github.
  • I am adelcambre (https://keybase.io/adelcambre) on keybase.
  • I have a public key whose fingerprint is 1BE4 CF33 AB8C F585 CF98 9A63 52A4 7A77 8EDE D0B4

To claim this, I am signing this object:

@adelcambre
adelcambre / server.rb
Created September 26, 2013 17:27
A small bit of code to demonstrate the Sockets API in Ruby via a very tiny, very bad, web server.
require 'socket'
NOT_FOUND = "HTTP/1.1 404 Not Found\nContent-Length: 9\n\nNot Found"
OK = "HTTP/1.1 200 OK\n"
socket = Socket.new(:INET, :STREAM)
sockaddr = Socket.sockaddr_in(11080, '127.0.0.1')
socket.bind(sockaddr)
socket.listen(5)