This file contains hidden or 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
| # given this code | |
| def foo | |
| a = 1 | |
| b = 2 | |
| unless false | |
| a = 2 | |
| b = 3 | |
| end |
This file contains hidden or 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
| # given this code | |
| def foo | |
| a = 1 | |
| b = 2 | |
| unless false | |
| a = 2 | |
| b = 3 | |
| end |
This file contains hidden or 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
| // unbind all bindings for a given object | |
| unbindAllEventsFor: function(obj){ | |
| var binder = this; | |
| _(this._eventBindings).chain(). | |
| filter(function(binding){ | |
| return binding.obj === obj; | |
| }). | |
| each(function(binding){ | |
| binder.unbindFrom(binding); |
This file contains hidden or 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 ActionView #:nodoc: | |
| module Helpers #:nodoc: | |
| extend ActiveSupport::Autoload | |
| autoload :ActiveModelHelper | |
| autoload :AssetTagHelper | |
| autoload :AtomFeedHelper | |
| autoload :BenchmarkHelper | |
| autoload :CacheHelper | |
| autoload :CaptureHelper |
This file contains hidden or 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 :gemcutter | |
| # we normally only list top-level dependencies in this file | |
| gem "activerecord-import", "~> 0.2.0" | |
| gem 'activerecord-postgres-hstore' | |
| gem "acts_as_list", "~> 0.1.4" | |
| gem "authorization-rails", "~> 1.0.12", :require => "authorization" | |
| gem 'awesome_print', :require => 'ap' | |
| gem 'nulogy-authlogic', '~>3.1', :require => 'authlogic' | |
| gem 'autocomplete_for', '~> 0.2.4' |
This file contains hidden or 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
| /* | |
| * Currently (as I understand it), BBCloneMail is organized as a hierarchy of modules, | |
| * where all modules communicate via req/resp, or commands, and all internals are implementation | |
| * details. | |
| * | |
| * for the purposes of conversation, I am calling modules that are conceptually bodies of code as | |
| * "sub applications", and modules that interact in those bodies of code as "modules" | |
| */ | |
| // psudo-code |
This file contains hidden or 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
| /* global Underscore jQuery console */ | |
| ;(function($){ | |
| // this is required to solve virtually any problem | |
| var logAllTheThings = false; | |
| function log(){ | |
| if(console && logAllTheThings) console.log.apply(console, arguments); | |
| } | |
This file contains hidden or 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
| /* global Underscore jQuery console */ | |
| ;(function($){ | |
| // this is required to solve virtually any problem | |
| var logAllTheThings = false; | |
| function log(){ | |
| if(console && logAllTheThings) console.log.apply(console, arguments); | |
| } | |
This file contains hidden or 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
| (defun semi-colonize () | |
| (interactive) | |
| (beginning-of-buffer) | |
| (query-replace-regexp "^ *[^/]+[^;,{}\n.]$" "\\&;")) | |
This file contains hidden or 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 'mongo' | |
| require 'nokogiri' | |
| require 'pg' | |
| task 'qcloud:migrate:standards' do | |
| mongo_conn = Mongo::Connection.new.db("qcloud") | |
| pg_conn = PG.connect(dbname: "qcloud_dev", host: 'localhost') | |
| standards_collection = mongo_conn["standards"] | |
| sheets_collection = mongo_conn["sheets"] |