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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "forwarded_port", guest: 3000, host: 3000 | |
config.vm.network "private_network", ip: "192.168.33.20" | |
config.vm.synced_folder ".", "/app", nfs: true |
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
require 'test/unit' | |
class GameTest < Test::Unit::TestCase | |
def test_a_cell_knows_its_neighbors | |
cell = Cell.new(1, 1) | |
expected_neighbours = [ | |
Cell.new(0, 0), Cell.new(1, 0), Cell.new(2, 0), | |
Cell.new(0, 1), Cell.new(2, 1), |
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
This application does not collect or publish any personal information. |
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 bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | |
tar -xvzf ruby-1.9.3-p194.tar.gz | |
cd ruby-1.9.3-p194/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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
echo "eval File.read('Gemfile')\ngem 'pry'" > Gemfile.local | |
echo "Gemfile.local\nGemfile.local.lock" >> .git/info/exclude | |
bundle install --gemfile Gemfile.local | |
BUNDLE_GEMFILE=Gemfile.local bundle list |
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
#coding: utf-8 | |
begin | |
require 'libnotify' | |
require 'tempfile' | |
require 'open-uri' | |
Earthquake.init do | |
help :who, 'show user name and icon', <<-HELP | |
⚡ :who yohfee |
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
# Sharp | |
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666", GROUP="plugdev" | |
# Sony Ericsson | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666", GROUP="plugdev" |
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
require 'method_source' | |
Earthquake.init do | |
command :source do |m| | |
puts commands.detect{|c| m[1] =~ c[:pattern]}[:block].source | |
end | |
end |
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
Earthquake.init do | |
command :pocky do |m| | |
sleep 0.5 until [:month, :day, :hour, :min, :sec].all?{|t| Time.now.send(t) == 11} | |
twitter.update m[1] | |
end | |
end |