Skip to content

Instantly share code, notes, and snippets.

View thebadmonkeydev's full-sized avatar

Michael Kelly thebadmonkeydev

View GitHub Profile
@thebadmonkeydev
thebadmonkeydev / Guardfile
Created March 11, 2020 14:28
Example Guardfile
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard :bundler do
watch('Gemfile')
end
guard :rspec, cmd: "bundle exec spring rspec --drb" do
require "guard/rspec/dsl"
dsl = Guard::RSpec::Dsl.new(self)
@thebadmonkeydev
thebadmonkeydev / rails_db_migrate.sh
Created November 7, 2017 08:32 — forked from igorescobar/rails_db_migrate.sh
The correct way to run rails db migration on AWS Beanstalk (Docker Container Environment)
#!/bin/bash
# .ebextensions/scripts/db_migrate.sh
. /opt/elasticbeanstalk/hooks/common.sh
EB_SUPPORT_FILES=$(/opt/elasticbeanstalk/bin/get-config container -k support_files_dir)
EB_CONFIG_DOCKER_ENV_ARGS=()
while read -r ENV_VAR; do
EB_CONFIG_DOCKER_ENV_ARGS+=(--env "$ENV_VAR")
@thebadmonkeydev
thebadmonkeydev / gist:15ae46b8cb86e9a21af48671a8b2114d
Last active August 10, 2016 19:18
Delete all local merged branches except master
git branch | grep -ve " master$" | xargs git branch -d
### Keybase proof
I hereby claim:
* I am thebadmonkeydev on github.
* I am michaelkelly322 (https://keybase.io/michaelkelly322) on keybase.
* I have a public key whose fingerprint is 69DE 6652 5845 70B8 BA32 4333 E5C0 FF81 AF83 E6BA
To claim this, I am signing this object:
@thebadmonkeydev
thebadmonkeydev / gist:e02b364fa6fa9dc3eaec
Created March 11, 2016 15:08
Delete all local branches EXCEPT master
git branch | grep ' master$' | xargs git branch -D
@thebadmonkeydev
thebadmonkeydev / spec_helper.rb
Last active February 24, 2016 20:45
Disable Webmock adapter after test suite
# Solved an issue with spec coverage reporting after spec runs
config.after(:suite) do
WebMock::HttpLibAdapters::NetHttpAdapter.disable!
end
@thebadmonkeydev
thebadmonkeydev / gist:a9efa66121ca9812a4e4
Created January 6, 2016 19:14
Dry Run a merge for conflicts
git format-patch master --stdout | git-apply --check
@thebadmonkeydev
thebadmonkeydev / gist:f977fdd468557ee5dc1d
Created July 10, 2015 01:47
Kill all docker containers
docker stop $(docker ps -a -q)