Skip to content

Instantly share code, notes, and snippets.

@erikdstock
erikdstock / ruby-closures.rb
Created September 26, 2017 20:38 — forked from pcantrell/ruby-closures.rb
Closures in Ruby
# CLOSURES IN RUBY Paul Cantrell http://innig.net
# Email: username "cantrell", domain name "pobox.com"
# I recommend executing this file, then reading it alongside its output.
#
# Alteratively, you can give yourself a sort of Ruby test by deleting all the comments,
# then trying to guess the output of the code!
# A closure is a block of code which meets three criteria:
@erikdstock
erikdstock / lint-diff-package.json
Last active May 2, 2017 21:04 — forked from kadamwhite/lint-diff-package.json
Use `git diff` and `grep` to selectively lint changed files
{
"scripts": {
"jshint:branch": "jshint $(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base head master) | grep '.js$') || true",
"jshint:diff": "jshint $(git diff --name-only --diff-filter=ACMRTUXB | grep '.js$') || true",
"jshint:prev": "jshint $(git diff head~1 --name-only --diff-filter=ACMRTUXB | grep '.js$') || true",
"coffeelint:diff": "coffeelint $(git diff --name-only --diff-filter=ACMRTUXB | grep '.coffee$') || true"
}
@erikdstock
erikdstock / 0_reuse_code.js
Created April 24, 2017 14:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console