Install (copy & paste):
curl -sL raw.github.com/gist/1676577/travis.rb > ~/bin/travis \
&& chmod +x ~/bin/travis
gem install hub | tail -2
ruby -e 'require "json"' 2>/dev/null || gem install json
# This file extends the Kernel's require function and adds the | |
# AutoReload module which allows to reload files once they have changed | |
# on the disk. | |
# | |
# Basically, you just require your files as usual, and if you want to update | |
# the files, either call AutoReload.reload(file) or AutoReload.reload_all. | |
# | |
# Usage: | |
# irb -rautoload | |
# |
This is an example of using RVM's Project .rvmrc file | |
to have it automatically bootstrap your environment, including bundler. | |
This could be further expanded to do anything you require :) | |
The important thing to remember is that the purpose of these files is | |
to allow you to very easily have your 'project context' (aka 'environment') | |
loaded automatically for you when you enter the project in the shell (cd). | |
You can generate the .rvmrc file below by running: |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
Rails.application.routes.draw do | |
get '/(:locale)/products/(:category)/(page/:page).:extension', | |
:to => 'products#index', | |
:as => :products, | |
:constraints => { | |
:locale => /[a-z]{2}/, | |
:category => /.+?/, | |
:page => /\d+/ | |
}, |
require 'faraday' | |
require 'net/http' | |
require 'pp' | |
# Repos: | |
# https://github.com/technoweenie/faraday | |
# https://github.com/pengwynn/faraday_middleware | |
# Blog posts: | |
# http://adventuresincoding.com/2010/09/writing-modular-http-client-code-with-faraday |
require 'rubygems' | |
require 'test/unit' | |
require 'em-http' | |
require 'vcr' | |
VCR.config do |c| | |
c.cassette_library_dir = 'fixtures/vcr_cassettes' | |
c.http_stubbing_library = :webmock | |
end |
class CarElement | |
def accept(visitor) | |
raise NotImpelementedError.new | |
end | |
end | |
module Visitable | |
def accept(visitor) | |
visitor.visit(self) | |
end |
// All navigation that is relative should be passed through the navigate | |
// method, to be processed by the router. If the link has a `data-bypass` | |
// attribute, bypass the delegation completely. | |
$(document).on("click", "a[href]:not([data-bypass])", function(evt) { | |
// Get the absolute anchor href. | |
var href = { prop: $(this).prop("href"), attr: $(this).attr("href") }; | |
// Get the absolute root. | |
var root = location.protocol + "//" + location.host + Application.root; | |
// Ensure the root is part of the anchor href, meaning it's relative. |