Skip to content

Instantly share code, notes, and snippets.

View W-Mills's full-sized avatar

Will Mills W-Mills

View GitHub Profile
#!/bin/bash
set -euo pipefail
# GIT_DIR isn't set for all hook events. Read this as GIT_DIR ||=
export GIT_DIR="${GIT_DIR-$(dirname "$(dirname "${BASH_SOURCE[0]}")")}"
if [[ -p /dev/fd/0 ]]; then # Check if STDIN is a pipe (i.e. we're getting input from Git)
INPUT=$(</dev/stdin)
fi
while read -r hook; do
if [[ -z "${INPUT+x}" ]]; then
"${hook}" "$@"
@lfender6445
lfender6445 / gist:9919357
Last active November 7, 2024 08:35
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@pusherman
pusherman / gist:3145761
Created July 19, 2012 18:13
HTML - Select list of US states
<select name="state" id="state">
<option value="" selected="selected">Select a State</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>