Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am mattgoldman on github.
* I am matthewgoldman (https://keybase.io/matthewgoldman) on keybase.
* I have a public key whose fingerprint is 11F3 8A6C 21E3 3276 1C3C FDAF EBFA 90D8 EA1E 19C0
To claim this, I am signing this object:
@mattgoldman
mattgoldman / hash_filter.rb
Last active December 26, 2015 08:59
Ruby module to evaluate a Hash against a set of filters. i.e. Does `{name: "John", age: 21}` pass the following filter?: `age > 20`
module HashFilter
# Runs filters on Hash and determines whether or not it shall pass
#
# ==== Attributes
#
# * +hash+ - +Hash+ to be filtered
# * +filters+ - +Array+ of objects containing the following keys for comparison
# <tt>:hash_key</tt> - Dot-notated, nestable hash key
# <tt>:comparison_operator</tt> - Any of the following comparison operators: +==+, +!=+, +<=+, +>=+, +<+, +>+
# <tt>:value</tt> - Desired value to compare for
@mattgoldman
mattgoldman / readme.md
Last active December 22, 2015 23:09
Rails 4 Engine using RSpec & Factory Girl

Run this command, replace gem_name

$   rails plugin new gem_name -T --mountable --dummy-path=spec/dummy # for namespaced mountable engine
$   rails plugin new gem_name -T --full --dummy-path=spec/dummy # for basic engine

Add the following to the Gemfile

gem "rspec-rails", "2.14.0.rc1"
gem "factory_girl_rails", "4.2.1"
@mattgoldman
mattgoldman / _skeleton.scss
Last active December 17, 2015 20:28
Simplified combination of Eric Meyer's Reset and Dave Gamache's Skeleton
/* #Reset & Basics
================================================== */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline; }
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {