Dallas.rb
RubyFlow
Sitepoint's Ruby
Ruby Weekly
DHH on Medium
SvN
The Ruby Rogues podcast
Ruby 5 podcast
Ruby Tapas Short Screencasts - $9/month
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 setup | |
generate(:controller, "welcome index") | |
route "root to: 'welcome#index'" | |
generate("devise:install") | |
generate("devise User") | |
environment 'config.action_mailer.default_url_options = { host: "localhost", port: 3000 }', env: 'development' | |
rails_command("db:migrate") | |
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
placeholderA = [] | |
placeholderB = [] | |
fh.each do |key, value| | |
case key | |
when "sortdescending" | |
placeholderA << "a['#{value}']" | |
placeholderB << "b['#{value}']" | |
when "sortascending" | |
placeholderA << "b['#{value}']" | |
placeholderB << "a['#{value}']" |
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
<!DOCTYPE html> | |
<html> | |
<title>Sort a HTML List Alphabetically HB</title> | |
<style> | |
div{ | |
border: solid; | |
padding: 1em; | |
margin: 1em; | |
} | |
</style> |
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
# find words that start with @ | |
def find_project(str) | |
p str.scan(/\B@(\w+)/i) | |
end | |
find_project('this is @cpord ford.') | |
find_project('this is hi@cpord ford.') |
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 hello(attrs) | |
@vin = attrs[:vin] | |
@vin_is_fake = attrs[:vin_is_fake] | |
if @vin_is_fake | |
puts 'true' | |
else | |
puts 'false' | |
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
johns-mbp:nrtest2 johnivanoff$ rspec | |
/Users/johnivanoff/.rvm/gems/ruby-2.1.2@nrtest2/gems/sass-3.2.19/lib/sass/version.rb:5: warning: loading in progress, circular require considered harmful - /Users/johnivanoff/.rvm/gems/ruby-2.1.2@nrtest2/gems/sass-3.2.19/lib/sass.rb | |
from /Users/johnivanoff/.rvm/gems/ruby-2.1.2@nrtest2/bin/ruby_executable_hooks:15:in `<main>' | |
from /Users/johnivanoff/.rvm/gems/ruby-2.1.2@nrtest2/bin/ruby_executable_hooks:15:in `eval' | |
from /Users/johnivanoff/.rvm/gems/ruby-2.1.2@nrtest2/bin/rspec:23:in `<main>' | |
from /Users/johnivanoff/.rvm/gems/ruby-2.1.2@nrtest2/bin/rspec:23:in `load' | |
from /Users/johnivanoff/.rvm/gems/ruby-2.1.2@nrtest2/gems/rspec-core-3.0.3/exe/rspec:4:in `<top (required)>' | |
from /Users/johnivanoff/.rvm/gems/ruby-2.1.2@nrtest2/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:38:in `invoke' | |
from /Users/johnivanoff/.rvm/gems/ruby-2.1.2@nrtest2/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:70:in `run' |
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
Johnny had half as many erasers as pencils. | |
He had nine times as many pinwheels as erasers. | |
He had a total os 120 peices. | |
How many pencils did Johnny have? | |
Show your work. | |
120 = x+(x*.5)+((x*.5)*9) |
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
test$ ruby feed_aggregator_test.rb | |
Loaded suite feed_aggregator_test | |
Started | |
.. | |
Finished in 0.112374 seconds. | |
2 tests, 3 assertions, 0 failures, 0 errors, 0 skips |
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 'sinatra' | |
require 'nokogiri' | |
require 'open-uri' | |
feed = 'http://api.flickr.com/services/feeds/groups_pool.gne?id=1373979@N22&lang=en-us&format=rss_200' | |
def parse feed | |
doc = Nokogiri::XML(open(feed)) | |
doc.search('item').map do |doc_item| | |
item = {} |
NewerOlder