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
something = case option_type | |
when OptionType then "do this" | |
when String then "do this thing" | |
else "how about this" | |
end | |
something = if option_type.class == OptionType | |
"do this" | |
elsif option_type.class == String | |
"do this thing" |
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] pry(main)> hash = {a: 1, b: 2, c: 3} | |
=> {:a=>1, :b=>2, :c=>3} | |
[2] pry(main)> class Hash | |
[2] pry(main)* def retrieve_keys(*keys) | |
[2] pry(main)* self.reduce({}) { |h, (k, v)| | |
[2] pry(main)* keys.include?(k) ? h.merge!({k => v}) : h | |
[2] pry(main)* } | |
[2] pry(main)* end | |
[2] pry(main)* end | |
=> 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
Hi, your instructions kind of suck but I figured it out. Here's how to actually do it: | |
From the iOS app... | |
1) Go to the Me tab, tap the gear icon, then click settings | |
2) Tap on the account name to open the notifications settings for that account (critical missing piece of info) | |
3) Disable "Recommendations" "news" and "other" | |
Pat |
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
default_attributes chef_user: "ubuntu" | |
default_attributes { ... a whole mess of other stuff which apparently blows away the first line. whoops } |
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
pat-jukely:active_rest_client pat$ pwd | |
/Users/pat/code/opensource/active_rest_client | |
pat-jukely:active_rest_client pat$ bundle install | |
OH HAI! I am /Users/pat/code/opensource/active_rest_client/Gemfile | |
OH HAI! I am /Users/pat/code/opensource/active_rest_client/Gemfile | |
Resolving dependencies... | |
... | |
Your bundle is complete! | |
It was installed into ./vendor/bundle | |
OH HAI! I am /Users/pat/code/opensource/active_rest_client/Gemfile |
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 'approvals/rspec' | |
def output_methods(target, methods) | |
methods.inject([]) do |results, m| | |
results << %("#{target}".#{m} => #{target.send(m)}) | |
end | |
end | |
describe "Ruby standard library" do | |
it "has a useful String class" do |
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 StarWrapper | |
def initialize(stream) | |
@stream = stream | |
end | |
def puts(string) | |
print_header_line string | |
@stream.print "* " | |
@stream.print string | |
@stream.puts " *" |
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 'rspec' | |
class Order | |
def initialize(customer_name) | |
@customer_name = customer_name | |
@items = [] | |
end | |
def purchase(name, quantity, price) | |
@items << {name: name, quantity: quantity, price: price} |
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
Hi, I haven't used Gemfury at all (yet) and I've only briefly clicked around... | |
I hope you don't mind answering some questions that might be covered elsewhere that | |
I just haven't found yet. | |
I want to distribute code to RubySteps members. I've been using git, which is obviously awesome, | |
but it doesn't really let me limit who gets what and when. I thought that was an advantage at | |
first, but it turns out that people get overwhelmed when I just throw the whole thing at them. | |
I could create a separate git repository for each member and push their new code there... |
OlderNewer