- Install VirtualBox
- Install Vagrant
- Download Ubuntu Server ISO
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 python | |
'''\ | |
Usage: cookbookdiff COOKBOOK_NAME COOKBOOK_VER LOCAL_PATH [--nocolor] | |
Diff your LOCAL_PATH against what is on the chef server for a | |
given cookbook and version. | |
--nocolor: don't pipe output through 'colordiff' (in case you want to pipe to something else) | |
Examples: | |
cookbookdiff percona_toolkit 0.0.4 ~/chef-repo/cookbooks/percona_toolkit |
A collection of Splunk recipes for Heroku logs. Instructions for setting up Splunk Storm with Heroku can be found here. For the vast majority of these recipes you'll need to have enabled the Heroku labs feature, log-runtime-metrics, for your application.
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 'paperclip' | |
module Paperclip | |
# Mechanize unlinks its Tempfiles immediately after creating them and some | |
# Paperclip functionality relies on an actual file available in the | |
# filesystem; not just a reference. | |
class MechanizeDownloadAdapter < AbstractAdapter | |
def initialize(target) | |
@target = target | |
cache_current_values |
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 UriParser | |
def self.uri_is_image?(uri) | |
case File.extname(uri.path) | |
when '.jpg', '.png', '.gif' | |
return true | |
else | |
return false | |
end | |
end | |
end |
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 'request_spec_helper' | |
describe "Errors" do | |
context "test", driver: :rack_test do | |
include Rack::Test::Methods | |
def app | |
app = Rack::Builder.new do | |
run Rewarder::Application | |
end.to_app |
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 'rack/test' | |
describe SampleMiddleware do | |
include Rack::Test::Methods | |
let(:inner_app) do | |
lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['All good!'] } | |
end | |
let(:app) { SampleMiddleware.new(inner_app) } |
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
def wait_until_element_exists(element) | |
wait_until { page.find(element).visible? } | |
return unless block_given? | |
within element do | |
yield | |
end | |
rescue Capybara::TimeoutError | |
flunk "Expected '#{element}' to be present." | |
end |
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 'tree' | |
require 'rspec' | |
# 2 | |
# / \ | |
# 1 4 | |
# / | |
# 3 | |
# | |
# |