Skip to content

Instantly share code, notes, and snippets.

@bnadlerjr
bnadlerjr / core.js
Created September 12, 2017 14:29 — forked from patrick99e99/core.js
var Core = (function($) {
return {
modules: {},
addModule: function(module_name, fn) {
// create new sandbox for module
var sandbox = new Sandbox(module_name);
@bnadlerjr
bnadlerjr / errors.clj
Created October 7, 2015 13:20 — forked from adambard/errors.clj
An example of functional error handling in clojure.
(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 *@*.*"
Array::partition = (callback) ->
[positive, negative] = [[], []]
for item, index in @
(if callback item, index then positive else negative).push item
[positive, negative]
Fork this and add your example
# = Extract Superclass
#
# == Before Refactor
class Department
attr_reader :total_annual_cost, :name, :head_count
end
class Employee
@bnadlerjr
bnadlerjr / update_bundles
Created September 21, 2010 02:12 — forked from dmcinnes/update_bundles
Script for downloading vim files for use with pathogen.
#!/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"