Skip to content

Instantly share code, notes, and snippets.

Andy Delcambre adelcambre

Block or report user

Report or block adelcambre

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View prepend_prepend.rb
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 }
View clean-merged-branches.sh
#!/bin/sh
#/ Usage: clean-merged-branches
#/ Delete locally merged branches
set -e
# show usage maybe
[ "$1" = "--help" ] && {
grep '^#/' <"$0"| cut -c4-
exit 0
View keybase.md

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:

View aliases.sh
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 Aug 29, 2015
Surviving tokyo
View 00_tokyo.md

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 Sep 3, 2014
Simple script to make lots of test files
View make_some_files.sh
for i in `seq 1000`; do
echo $i
touch $i
# or dd if=/dev/zero of=$i count=100 bs=1m
done
View keybase.md

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 Sep 26, 2013
A small bit of code to demonstrate the Sockets API in Ruby via a very tiny, very bad, web server.
View server.rb
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)
You can’t perform that action at this time.