This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires socat on host and boot2docker | |
# OSX - brew install socat | |
# boot2docker - tce-load -wi socat | |
# change your ssh key path | |
sudo socat "UNIX-LISTEN:/var/run/docker.sock,reuseaddr,fork" EXEC:'ssh -i /Users/aaron.feng/.ssh/id_boot2docker [email protected] socat STDIO UNIX-CONNECT\:/var/run/docker.sock' | |
# own the unix socket on host | |
sudo chown aaron.feng /var/run/docker.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/groovy | |
def findMissingNumber(def a) { | |
lowerSum = a.inject(0, { | |
sum, it -> sum += it | |
}) | |
upperSum = (1..(a.size + 1)).inject(0, { | |
sum, it -> sum += it | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python2.6 | |
# | |
# Copyright 2011 James Aguilar | |
# Released under the new BSD license. | |
# | |
# Dependencies: | |
# - gflags | |
# - Beautiful Soup | |
from BeautifulSoup import BeautifulSoup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ask_password(message) | |
HighLine.new.ask(message) do |q| | |
q.echo = false | |
end | |
end |