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
gem 'spork', '1.0.0rc' | |
gem 'simplecov', :require => false |
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
class Map | |
attr_accessor :tiles, :start, :finish | |
WATER_VALUE = 10_000 | |
FLATLAND_VALUE = 1 | |
FOREST_VALUE = 2 | |
MOUNTAIN_VALUE = 3 | |
START_KEY = "@" | |
FINISH_KEY = "x" |
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
group :development, :test do | |
gem 'ruby-debug19', :require => 'ruby-debug' | |
gem 'rspec-rails', '2.8.0' | |
gem 'factory_girl_rails', '1.1.rc1' | |
gem 'database_cleaner', '0.7.1' | |
gem 'spork', '0.9.0' | |
gem 'launchy' | |
gem 'capybara' | |
gem 'capybara-webkit' |
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
gem 'paperclip', '2.7.0' | |
gem 'aws-sdk', '~> 1.3.4' |
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
james ~ $ netx | |
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
postgres 60855 james 5u IPv6 0xffffff800afe09c0 0t0 TCP [::1]:postgresql (LISTEN) | |
postgres 60855 james 6u IPv4 0xffffff800ff86160 0t0 TCP 127.0.0.1:postgresql (LISTEN) | |
postgres 60855 james 7u IPv6 0xffffff800afdf700 0t0 TCP [fe80:1::1]:postgresql (LISTEN) |
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
CREATE OR REPLACE FUNCTION calculate_dialup( | |
hours real, | |
service_dialup_id int | |
) RETURNS real as $$ | |
DECLARE | |
dialup service_dialups%ROWTYPE; | |
excess_usage_charge real := 0; | |
BEGIN | |
SELECT * INTO dialup FROM service_dialups WHERE id = service_dialup_id; | |
-- ... |
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
class Trie | |
def initialize | |
@root = {} | |
end | |
def build(string) | |
node = @root | |
string.chars.each do |char| | |
node[char] ||= {} |
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 "benchmark" | |
trie = Trie.new | |
dictionary = IO.read("/usr/share/dict/words").split("\n") | |
puts "/usr/share/dict/words has #{dictionary.size} words." | |
Benchmark.bm(15) do |benchmark| | |
benchmark.report("build (iterative)") do | |
trie = Trie.new |
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
PATH=/usr/local/bin:$PATH |
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
$ git commit | |
error: There was a problem with the editor 'vi'. | |
Please supply the message using either -m or -F option. | |
$ echo $? | |
1 | |
$ git config --global core.editor /usr/bin/vim | |
$ git commit | |
[feature/tag-search 0167ee2] Merge branch 'master' of github.com:jamesmoriarty/project-x into feature/tag-search | |
$ echo $? | |
0 |