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
require 'execjs' | |
class HandlebarsFilter < Filter | |
class << self | |
def contents | |
@@contents ||= [File.read("headless-ember.js"), File.read("ember.js")].join("\n") | |
end | |
def context | |
@@context ||= ExecJS.compile(contents) |
/*! | |
* Backbone Module Manager - v0.1pre - 9/9/2011 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2011 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
function ModuleManager(fn) { |
This gist is no longer valid. Please see Compass-Rails for instructions on how to install.
class ApplicationController < ActionController::Base | |
before_filter :ensure_proper_protocol | |
protected | |
def ssl_allowed_action? | |
(params[:controller] == 'users/sessions' && ['new', 'create'].include?(params[:action])) || | |
(params[:controller] == 'users/registrations' && ['new', 'create', 'edit', 'update'].include?(params[:action])) || | |
(params[:controller] == 'users/omniauth_callbacks') | |
end |
require 'sinatra' | |
require 'omniauth' | |
class Application < Sinatra::Base | |
use OmniAuth::Builder do | |
provider :github, 'github_id', 'github_secret' | |
end | |
get '/' do |
// | |
// Backbone.Rails.js | |
// | |
// Makes Backbone.js play nicely with the default Rails setup, i.e., | |
// no need to set | |
// ActiveRecord::Base.include_root_in_json = false | |
// and build all of your models directly from `params` rather than | |
// `params[:model]`. | |
// | |
// Load this file after backbone.js and before your application JS. |
package_assets: on # (on, off, always) | |
embed_assets: on # (on, off, datauri) | |
compress_assets: on # (on, off) | |
gzip_assets: on # (on, off) | |
template_function: _.template # (defaults to the built-in micro-templating) | |
package_path: packages # (defaults to assets) | |
javascript_compressor: closure # (yui, closure) | |
compressor_options: | |
compilation_level: ADVANCED_OPTIMIZATIONS |
# You should define those models. (you can change the model names) | |
# | |
# * Oauth2::Client | |
# * Oauth2::AccessToken | |
# * Oauth2::RefreshToken | |
# * Oauth2::AuthorizationCode | |
class Oauth2Controller < ApplicationController | |
before_filter :require_authentication, :only => :authorize |
# environment.rb | |
# | |
# These are models you should define. (you can change the model name, of course) | |
# * Oauth2::AccessToken | |
Rails::Initializer.run do |config| | |
: | |
require 'rack/oauth2' | |
oauth2_authenticator = lambda do |request| | |
access_token = Oauth2::AccessToken.find_by_token(request.access_token) |