gpf='git push --force-with-lease'
gca='git commit -v -a'
gpthis='git push origin HEAD:$(git_current_branch) && git branch -u origin/$(git_current_branch) $(git_current_branch) && echo "pushed current branch and set upstream to origin"'
gco='git checkout'
g='grep -i --color=auto'
hb='hub browse'
View .pryrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using these pry gems -- copy to your Gemfile | |
# group :development, :test do | |
# gem 'awesome_print' # pretty print ruby objects | |
# gem 'pry' # Console with powerful introspection capabilities | |
# gem 'pry-byebug' # Integrates pry with byebug | |
# gem 'pry-doc' # Provide MRI Core documentation | |
# gem 'pry-rails' # Causes rails console to open pry. `DISABLE_PRY_RAILS=1 rails c` can still open with IRB | |
# gem 'pry-rescue' # Start a pry session whenever something goes wrong. | |
# gem 'pry-theme' # An easy way to customize Pry colors via theme files | |
# end |
View run-commands-async.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Edit the list of commands. | |
# YOU MUST USE SINGLE QUOTES HERE. | |
commands=( | |
'yarn run build:client-bundles:prod' | |
'yarn run build:server-bundle:prod' | |
'yarn run build:global-styles:prod' | |
) |
View .pryrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using these pry gems -- copy to your Gemfile | |
# group :development, :test do | |
# gem 'awesome_print' # pretty print ruby objects | |
# gem 'pry' # Console with powerful introspection capabilities | |
# # pick either: | |
# # using byebug, but has issues with Zeitwerk | |
# gem 'pry-byebug' # Integrates pry with byebug | |
# | |
# # using default ruby debuggger | |
# gem 'pry-stack_explorer' |
View .pryrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using these pry gems -- copy to your Gemfile | |
# group :development, :test do | |
# gem 'awesome_print' # pretty print ruby objects | |
# gem 'pry' # Console with powerful introspection capabilities | |
# # pick either: | |
# # using byebug, but has issues with Zeitwerk | |
# gem 'pry-byebug' # Integrates pry with byebug | |
# | |
# # using default ruby debuggger | |
# gem 'pry-stack_explorer' |
View .tmux.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-option -g default-shell /bin/zsh | |
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard | |
# http://brentvatne.github.com/tmux-copy-paste/ | |
# this next command takes the current buffer and puts it on the OS clipboard | |
#bind Y run "tmux save-buffer - | reattach-to-user-namespace pbcopy" | |
# | |
# I don't understand why the next would be useful | |
# bind P run "tmux paste-buffer" | |
bind y copy-mode |
View check_db_version.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Method to check the DB version matches | |
# We ran into an issue where different versions of postgres caused inconsistent results. | |
def check_db_version | |
expected_db_version = "PostgreSQL 9.4" | |
adapter = ActiveRecord::Base.connection.adapter_name | |
sql = case adapter | |
when "MSSQL" | |
"SELECT @@VERSION" | |
when "MySQL", "Mysql2", "PostgreSQL" | |
"SELECT VERSION()" |
View rails_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV["RAILS_ENV"] ||= "test" | |
require File.expand_path("../../config/environment", __FILE__) | |
require "rspec/rails" | |
require "rspec/mocks" | |
require "capybara/rspec" | |
require "vcr" | |
require "rails/application" | |
require "webmock/rspec" | |
require "shoulda/matchers" | |
require "capybara-screenshot/rspec" |
View justin-shell-tips.md
View git-helpers.zsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# depends on justin808 gist named utility.zsh | |
# https://gist.github.com/justin808/bdef67f37c2cbdba898a | |
# See forum discussion: http://forum.railsonmaui.com/t/zsh-with-git-flow/135 | |
#### GIT #### | |
# http://superuser.com/questions/458906/zsh-tab-completion-of-git-commands-is-very-slow-how-can-i-turn-it-off | |
# fix slow completion on files | |
# __git_files () { | |
# _wanted files expl 'local files' _files |
View gist:bd75f4aba6bb775e45f26f56ef9cf826
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################################################################## | |
######################################################################################################################## | |
# run-prod-locally.sh | |
######################################################################################################################## | |
echo "Only run this once to set your production setup after changing JS assets." | |
echo "You can run foreman start -f Procfile.local-prod to restart the server without recompiling" | |
echo "You may want to have your /application.yml and /config/database.yml reflect your development settings for production" | |
# Run the rake tasks as production | |
RAILS_ENV=production rake assets:clobber |
NewerOlder