Skip to content

Instantly share code, notes, and snippets.

@unikitty37
unikitty37 / pre-commit
Last active January 25, 2023 08:03
Git pre-commit hook to reject RSpec files with 'focus: true' in them
#!/bin/sh
function check_diffs () {
FOLDER_PATTERN="$1"
FILES_PATTERN="$2"
FORBIDDEN="$3"
FORBIDDEN_PRINTABLE="${4:-$3}"
CHANGED_FILES=$(git diff --cached --name-only | egrep $FOLDER_PATTERN | egrep $FILES_PATTERN)
OK=1
for FILE in $CHANGED_FILES ; do
@unikitty37
unikitty37 / env.rb
Created February 13, 2012 12:42
env.rb for Cucumber
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require 'cucumber/rails'
require 'factory_girl/step_definitions'
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
@unikitty37
unikitty37 / with_reset.css
Created January 5, 2012 09:48
CSS reset knocks out Google Fonts (compass/reset #639)
/*
*/
/* line 17, /Users/slacker/.rvm/gems/ruby-1.9.3-p0@wscamra/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
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,