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
1.9.2p290 :013 > render_erb("Hey, <%= first_name %> <%= last_name %>", :first_name => "James", :last_name => "Moriarty") | |
=> "Hey, James Moriarty" |
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
1.9.2p290 :083 > MyObject.configure do |config| | |
1.9.2p290 :084 > config.logger = STDOUT | |
1.9.2p290 :085?> end | |
=> MyObject | |
1.9.2p290 :190 > MyObject.new | |
=> #<MyObject:0x000001009ae268 @logger=#<IO:<STDOUT>>> | |
1.9.2p290 :191 > MyObject.new(:logger => nil) | |
=> #<MyObject:0x000001009a6928 @logger=nil> |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 Vector2 | |
# A 2 coordinate vector. | |
# http://en.wikipedia.org/wiki/Coordinate_vector | |
# @param x The x coordinate of the vector | |
# @param y The y coordinate of the vector | |
constructor:(@x = 0, @y = 0) -> | |
# Add 2 vectors. | |
# @param vector A vector | |
# @return vector |
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
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0 |
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) |