Running rake routes
with a new rails application displays no information.
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 'capybara' | |
require 'capybara/dsl' | |
Capybara.configure do |config| | |
config.run_server = false | |
config.app_host = 'http://www.google.com' | |
end | |
Capybara.current_driver = :selenium |
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
<?xml version="1.0"?> | |
<root> | |
<appdef> | |
<appname>Terminal</appname> | |
<equal>com.apple.Terminal</equal> | |
</appdef> | |
<item> | |
<name>TMUX Key Remappings</name> | |
<item> | |
<name>TMUX: Right Control to Ctrl+B</name> |
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 A | |
def hello ; puts "hello" ; end | |
def goodbye ; puts "goodbye" ; 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
def safely_load(mod,constant) | |
mod.const_get constant | |
rescue NameError | |
puts "#{mod}::#{constant} was not defined autoloadable, but caused NameError" | |
rescue LoadError | |
puts "#{mod}::#{constant} was not loadable" | |
end | |
def preload(mod) |
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
def check_valid_phone_number(phone_number) | |
number_length = phone_number.length | |
if number_length == 10 | |
phone_number | |
elsif number_length == 11 and phone_number[0] == '1' | |
phone_number[1..10] | |
else | |
invalid_number | |
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
packages = %w[ack gmp libvpx pkg-config | |
apple-gcc42 gnupg libxml2 postgresql | |
asciidoc gnutls libxmlsec1 proctools | |
autojump graphviz lighttpd qt | |
boo hub little-cms ragel | |
boost imagemagick lzo readline | |
bsdmake ios-sim mogenerator redis | |
clojure jasper mono rename | |
cmake john mpc rtmpdump | |
docbook jpeg multimarkdown scala |
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
$:.push('lib') | |
require 'sales_engine' | |
def display_load_path | |
puts "Current `$LOAD_PATH` (or `$:`):" | |
puts "Load Path: #{$:.join("\n")}" | |
end | |
desc "Add TEST directory to the load path" | |
task :load_path do |
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
module HasAttributes | |
def attribute(name) #id | |
# With the given name add an instance method with that name | |
# define_method(name) do | |
# instance_variable_get("@#{name}") | |
# end | |
attr_reader name | |
# With the given name add a class method find_by_NAME |
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 'date' | |
# puts "What are you? #{ARGV} #{ARGV.class}" | |
# Called as in `ruby example2.rb 1977 10 30` | |
# birthdate = ARGV.map {|arg| arg.to_i } | |
birthdate = [ 1977, 10, 30 ] | |
# year, month, day = [ 1977, 10, 30 ] | |
# birth_in_seconds = Date.new(year,month,day).to_time.to_i |