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 Core = (function($) { | |
return { | |
modules: {}, | |
addModule: function(module_name, fn) { | |
// create new sandbox for module | |
var sandbox = new Sandbox(module_name); | |
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
(ns example.errors) | |
(defn clean-address [params] | |
"Ensure (params :address) is present" | |
(if (empty? (params :address)) | |
[nil "Please enter your address"] | |
[params nil])) | |
(defn clean-email [params] | |
"Ensure (params :email) matches *@*.*" |
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
Array::partition = (callback) -> | |
[positive, negative] = [[], []] | |
for item, index in @ | |
(if callback item, index then positive else negative).push item | |
[positive, negative] |
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
Fork this and add your example | |
# = Extract Superclass | |
# | |
# == Before Refactor | |
class Department | |
attr_reader :total_annual_cost, :name, :head_count | |
end | |
class Employee |
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
#!/usr/bin/env ruby | |
git_bundles = [ | |
"git://github.com/vim-bundles/fuzzyfinder.git", | |
"git://github.com/scrooloose/nerdcommenter.git", | |
"git://github.com/msanders/snipmate.vim.git", | |
"git://github.com/tpope/vim-cucumber.git", | |
"git://github.com/tpope/vim-haml.git", | |
"git://github.com/tpope/vim-rails.git", | |
"git://github.com/tpope/vim-surround.git" |