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
var Sample = function() { | |
var iamHidden = "you can't see me!"; | |
this.lookInside = function() { | |
return iamHidden; | |
}; | |
}; | |
describe("Sample", function() { | |
it("should be equal", function() { |
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
# encoding: UTF-8 | |
Capistrano::Configuration.instance(:must_exist).load do | |
namespace :rails do | |
desc "Open the rails console on one of the remote servers" | |
task :console, :roles => :app do | |
hostname = find_servers_for_task(current_task).first | |
exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && #{current_path}/script/rails c #{rails_env}'" | |
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
Pling.configure do |config| | |
config.gateways.use Pling::Gateway::C2DM, { :email => '', :password => '', :source => '' } | |
config.adapter = Pling::Adapter::Resque.new | |
end | |
Resque.before_first_fork do | |
Pling.gateways.initialize! | |
Pling.middlewares.initialize! | |
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
# config/initializers/active_model_serializers.rb | |
Mongoid::Document.send(:include, ActiveModel::SerializerSupport) | |
Mongoid::Criteria.delegate(:active_model_serializer, :to => :to_a) |
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 Mongoid | |
module MassAssignmentSecurity | |
extend ActiveSupport::Concern | |
included do | |
attr_accessible nil | |
end | |
end | |
module Document |
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
Spork.each_run do | |
if Spork.using_spork? | |
ActionDispatch::Reloader.cleanup! | |
ActionDispatch::Reloader.prepare! | |
FactoryGirl.reload | |
end | |
# This line should only be necessary when you have support files | |
# that use a namespace which is defined somewhere in your application. | |
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} |
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 'spec_helper' | |
describe ProjectsController do | |
let(:project) { double(:project) } | |
let(:projects) { [project] } | |
describe 'GET show' do | |
let(:params) { { :id => 1, :format => :json } } |
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
\lstdefinelanguage{ECMAScript} | |
{morekeywords={break, else, new, var, case, finally, return, void, catch, for, switch, while, continue, function, this, with, default, if, throw, delete, in, try, do, instanceof, typeof, | |
abstract, enum, int, short, boolean, export, interface, static, byte, extends, long, super, char, final, native, synchronized, class, float, package, throws, const, goto, private, transient, | |
debugger, implements, protected, volatile, double, import, public}, | |
sensitive, | |
morecomment=[l]//, | |
morecomment=[s]{/*}{*/}, | |
morestring=[b]", | |
morestring=[b]', | |
}[keywords,comments,strings] |
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
Model.elem_match(:embedded => { :a => 1, :b => 2 }) | |
# => #<Mongoid::Criteria | |
# selector: {"embedded"=>{"$elemMatch"=>{:a=>1, :b=>2}}} | |
# options: {} | |
# class: Model | |
# embedded: false> | |
Model.elem_match(:embedded => { :a => 1 }).elem_match(:embedded => { :b => 2 }) | |
# => #<Mongoid::Criteria | |
# selector: {"embedded"=>{"$elemMatch"=>{:b=>2}}} |
OlderNewer