Skip to content

Instantly share code, notes, and snippets.

View elliotthilaire's full-sized avatar

Elliott Hilaire elliotthilaire

View GitHub Profile
@elliotthilaire
elliotthilaire / pre-push
Last active October 12, 2018 10:07
A pre-push git hooking using the pronto gem
#!/bin/sh
# To reinstall this script in the same or another git repo run:
# curl -sSL https://gist.githubusercontent.com/elliotthilaire/cef91754bb296d67e776/raw/pre-push > .git/hooks/pre-push; chmod +x .git/hooks/pre-push
# check that pronto is installed
hash pronto 2>/dev/null || {
echo >&2 "Pronto is not installed. Install with 'gem install pronto pronto-rubocop'";
echo >&2 "Find other Pronto runners at https://github.com/mmozuras/pronto#runners";
exit 0;
@elliotthilaire
elliotthilaire / fish-gotchas.md
Last active August 29, 2015 14:26
Bash things that don't work in Fish.

Command syntax

echo $(date +”%m_%d_%Y”)

Rewrite as

echo (date +”%m_%d_%Y”)

RVM

#!/bin/bash
APP_NAME="your-app-name-goes-here"
APP_PATH=/home/deploy/${APP_NAME}
# Production environment
export RAILS_ENV="production"
# This loads RVM into a shell session. Uncomment if you're using RVM system wide.
# [[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm"
@elliotthilaire
elliotthilaire / bash-change-colour-on-ssh
Last active August 29, 2015 14:09
Change the visual theme of Terminal.app during an SSH connection
# Add this to your .bash_profile file.
# Assumes you are running a OSX, using the default Terminal.app, and have Homebrew (for its custom theme) installed.
# Inspiration from: https://gist.github.com/porras/5856906
function colorssh() {
# Change the theme of Terminal.app
osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"Homebrew\"";
# Run the `ssh` command
ssh $*