This file contains hidden or 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
# On a new ubuntu 14.04 box, as root, with the following variables | |
# export BUILDBOX_AGENT_NAME="buildbox-agent-N" | |
# export BUILDBOX_AGENT_ACCESS_TOKEN="<your token here>" | |
# export BUILDBOX_AGENT_SSH_PRIVATE_KEY="<an ssh private key>" | |
# export BUILDBOX_AGENT_SSH_PUBLIC_KEY="<an ssh public key>" | |
# Make tmp totally in memory | |
echo "none /tmp tmpfs size=4g 0 0" >> /etc/fstab | |
mount /tmp |
This file contains hidden or 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
class Dependency | |
def self.foo | |
puts "Foo" | |
end | |
def self.bar | |
puts "Bar" | |
end | |
end |
This file contains hidden or 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
require 'test/unit' | |
require 'enumerator' | |
class Array | |
def in_chunks_of(size_of_chunks) | |
enum_slice(size_of_chunks).to_a | |
end | |
end | |
class TestArrayInChunks < Test::Unit::TestCase |
This file contains hidden or 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
value = "Don T Alias" | |
first_name, last_name = value.reverse.split(' ', 2).reverse.collect(&:reverse) | |
first_name = first_name.to_s | |
last_name = last_name.to_s | |
# Refactored to take into account Xavier's pathological aversion to case statements: | |
words = value.split(' ') | |
first_name, last_name = if words.size == 0 | |
['', ''] | |
elsif words.size == 1 |