git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| require 'set' | |
| class ExceptionTester | |
| class TestException < Exception | |
| end | |
| # Accepts a block containing the code you want to make exception safety | |
| # assertions about. | |
| def initialize(&exercise) | |
| @exercise = exercise |
| <% | |
| # | |
| # I originally needed to create a sidebar partial that had a div area where I could place custom links into. Finally found it. | |
| # When I was trying to figure this out before and realized I needed to pass the view into :layout, rather than just using render 'layout'. Not sure why the block can't be passed otherwise but nonetheless... | |
| # | |
| # For explanation of options see | |
| # http://guides.rubyonrails.org/layouts_and_rendering.html#options-for-render | |
| # | |
| %> |
| module JQueryEventsHelpers | |
| def trigger_change(jQuerySelector) | |
| script = "$('#{jQuerySelector}').trigger('change');" | |
| page.execute_script(script); | |
| end | |
| end | |
| World(JQueryEventsHelpers) |
| # usage: | |
| # it "should return a result of 5" do | |
| # eventually { long_running_thing.result.should eq(5) } | |
| # end | |
| module AsyncHelper | |
| def eventually(:options = {}) | |
| timeout = options[:timeout] || 2 | |
| interval = options[:interval] || 0.1 | |
| time_limit = Time.now + timeout | |
| loop do |
| require 'openssl' | |
| require 'net/http' | |
| require 'net/https' | |
| module CloudFront | |
| extend self | |
| def invalidate(path) | |
| date = Time.now.utc | |
| date = date.strftime("%a, %d %b %Y %H:%M:%S %Z") |
| /* | |
| You can now create a spinner using any of the variants below: | |
| $("#el").spin(); // Produces default Spinner using the text color of #el. | |
| $("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el. | |
| $("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color). | |
| $("#el").spin({ ... }); // Produces a Spinner using your custom settings. | |
| $("#el").spin(false); // Kills the spinner. |
| // Lack of tail call optimization in JS | |
| var sum = function(x, y) { | |
| return y > 0 ? sum(x + 1, y - 1) : | |
| y < 0 ? sum(x - 1, y + 1) : | |
| x | |
| } | |
| sum(20, 100000) // => RangeError: Maximum call stack size exceeded | |
| // Using workaround |
| # | |
| # CONFIGURATION FOR USING SMS KANNEL WITH RAPIDSMS | |
| # | |
| # For any modifications to this file, see Kannel User Guide | |
| # If that does not help, see Kannel web page (http://www.kannel.org) and | |
| # various online help and mailing list archives | |
| # | |
| # Notes on those who base their configuration on this: | |
| # 1) check security issues! (allowed IPs, passwords and ports) | |
| # 2) groups cannot have empty rows inside them! |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream