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
(&:+) | |
= disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>========== | |
0000 trace 1 ( 1) | |
0002 duparray [1, 2, 3, 4, 5] | |
0004 putobject 0 | |
0006 putobject :+ | |
0008 send :inject, 2, nil, 0, <ic:0> | |
0014 leave | |
(:+) |
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
[1,2,3,4,5].inject(0, &:+) | |
============= :__script__ ============== | |
Arguments: 0 required, 0 post, 0 total | |
Arity: 0 | |
Locals: 0 | |
Stack size: 5 | |
Lines to IP: 1: 0..29 | |
0000: meta_push_1 |
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
" https://github.com/carlhuda/janus/blob/master/janus/vim/core/janus/after/plugin/vimrc_after.vim | |
" Customization | |
" | |
" This loads after the janus plugins so that janus-specific plugin mappings can | |
" be overwritten. | |
if filereadable(expand("~/.yadr/vim/after/.vimrc.after")) | |
source ~/.yadr/vim/after/.vimrc.after | |
endif |
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
get "/" | |
headers["Content-Disposition"] = "attachment;filename=the_file.txt" | |
headers["Content-Type"] = "..." | |
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
require 'rubygems' | |
require 'sinatra' | |
class Protected < Sinatra::Base | |
use Rack::Auth::Basic, "Protected Area" do |username, password| | |
self.authenticate username, password | |
end | |
get '/' do | |
"secret" |
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
# mocking stub chains with an assertion if the final call is made | |
# check https://github.com/rspec/rspec-mocks/issues/133 and | |
# https://groups.google.com/d/topic/rspec/Dc98rP-3IFM/discussion | |
require 'rspec' | |
class DevOps | |
attr_reader :monitor | |
def initialize(monitor = Monitor.new) |
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
Feature: Static content pages | |
As a store owner | |
I want to provide my customers with specific information | |
So that they can learn about my store | |
Scenario: Visit our Showroom | |
When I go to the visit our showroom page | |
Then I should see the heading "Visit Our Showroom" |
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 'rubygems' | |
require 'sinatra' | |
get '/' do | |
ENV['envvar'] | |
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
=> Booting WEBrick | |
=> Rails 2.3.5 application starting on http://0.0.0.0:3000 | |
/Users/benlovell/.rvm/gems/ruby-1.9.1-p376/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `rescue in load_missing_constant': uninitialized constant ActiveMerchant::Billing::ActiveMerchantError (NameError) | |
from /Users/benlovell/.rvm/gems/ruby-1.9.1-p376/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:436:in `load_missing_constant' | |
from /Users/benlovell/.rvm/gems/ruby-1.9.1-p376/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies' | |
from /Users/benlovell/.rvm/gems/ruby-1.9.1-p376/gems/activemerchant-1.5.1/lib/active_merchant/billing/response.rb:4:in `<module:Billing>' | |
from /Users/benlovell/.rvm/gems/ruby-1.9.1-p376/gems/activemerchant-1.5.1/lib/active_merchant/billing/response.rb:2:in `<module:ActiveMerchant>' | |
from /Users/benlovell/.rvm/gems/ruby-1.9.1-p376/gems/activemerchant-1.5.1/lib/active_merchant/billing/response. |
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 'open-uri' | |
# url dsl -- the ultimate url dsl! | |
# | |
# You just can't beat this: | |
# | |
# $ irb -r url_dsl | |
# >> include URLDSL | |
# => Object | |
# >> http://github.com/defunkt.json |