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
module PythonishDecorator | |
def method_added(name) | |
return unless @decorations | |
decorations = @decorations.dup | |
@decorations = nil | |
alias_method "undecorated_#{name}", name | |
define_method(name) do |*args| |
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
# JSON-encoded error and redirect results for Devise controllers. | |
# This overrides an internal method of Devise, so be careful when updating Devise! | |
# | |
# Usage: | |
# | |
# class Users::RegistrationsController < Devise::RegistrationsController | |
# include DeviseJsonAdapter | |
# end | |
# | |
# devise_for :users, :controllers => { :registrations => "users/registrations" } |
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
/* | |
* jasmine.requirejs() returns a function that will load the file(s) required | |
* and will wait until it's done before proceeding with running specs. | |
* The function returned is intended to be passed to beforeEach() so the file(s) | |
* is(are) loaded before running each spec. | |
* | |
* Syntax: | |
* | |
* jasmine.requirejs(options, files) | |
* or |
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
SC.TemplateChangingView = SC.TemplateView.extend( | |
/** @scope SC.TemplateChangingView.prototype */{ | |
templateNameDidChange: function() { | |
SC.Logger.debug("Template name was set to " + this.get('templateName')); | |
this.rerender(); | |
}.observes('template'), | |
/** | |
Called when the template property associated with this view changes. |
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 InfoDesk | |
def trains | |
:trains | |
end | |
def flights | |
:flights | |
end | |
def buses | |
:buses | |
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
if Rails.env.production? | |
require 'fileutils' | |
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets", "admin")) | |
template_path_one = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/app/assets/stylesheets" | |
template_path_two = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/lib/active_admin/sass" | |
old_compile_path = "#{Rails.root}/public/stylesheets/admin" | |
new_compile_path = "#{Rails.root}/tmp/stylesheets/admin" | |
Sass::Plugin::remove_template_location template_path_one |
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
jQuery.get('/templates/foo.handlebars', function(data) { | |
var template = SC.Handlebars.compile(data); | |
SC.TEMPLATES['foo'] = template; | |
}) |
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
group :assets do | |
gem 'sass-rails', '~> 3.1.0' | |
gem 'coffee-rails', '~> 3.1.0' | |
gem 'uglifier' | |
gem 'compass' | |
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
source "http://rubygems.org" | |
group :development do | |
gem 'rake' | |
gem 'guard' | |
gem 'coffee-script' | |
gem 'rb-fsevent' | |
gem 'rb-inotify' | |
gem 'compass', '0.11.5' | |
gem 'sass', '3.1.5' | |
gem 'guard-compass' |
OlderNewer