Skip to content

Instantly share code, notes, and snippets.

Bradley Schaefer soulcutter

Block or report user

Report or block soulcutter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
JoshCheek / routes
Created May 4, 2018
Cache / filter / reformat filtered routes since `rake routes` is so expensive.
View routes
#!/usr/bin/env ruby
argv = ARGV
# handle help screen
if argv.any? { |arg| arg == '-h' || arg == '--help' }
$stderr.puts <<~HELP
Usage: routes [--load] [--reload] [filter ...]
Runs `bin/rake routes` and caches the result so that you don't have to wait
kddeisz / test_helper.rb
Created Jan 30, 2018
Tracking delegations in the test run
View test_helper.rb
# Hook into delegate to make sure those don't go stale
ActiveRecord::Base.singleton_class.prepend( do
def delegate(*, **) do |method_name|
tracking_key = "#{name}##{method_name}"
DELEGATION_CALLS[tracking_key] = 0
smcabrera / .vimrc
Last active Nov 15, 2016
Some sensible defaults for a .vimrc
View .vimrc
"== Vundle Plugin Manager
"found here:
set rtp+=~/.config/nvim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
"== Plugins: Sensible Defaults
benwalsh / gist:0e3fa2276ffe2f03fef5
Created May 14, 2015
Capistrano for manifests
View gist:0e3fa2276ffe2f03fef5
after "deploy:assets:precompile", "download_asset_manifest"
after "download_asset_manifest", "upload_asset_manifest"
desc "Download the compiled asset manifest .json file"
task :download_asset_manifest, roles: :admin do
set(:manifest_json, capture("ls #{ release_path }/public/assets/manifest*json").strip.split("/").last)
download "#{ release_path }/public/assets/#{ manifest_json }", "/tmp/#{ manifest_json }"
desc "Upload the asset manifest file"
xaviershay /
Last active Dec 24, 2015
SASS + Coffee + Concatenation in prod
set -exo pipefail
if [ `uname` == 'Darwin' ]; then
JSCOMPRESSOR="yuicompressor --type js"
idrozd / translatable.rb
Created Jul 19, 2013
Ruby Translatable
View translatable.rb
# Motivation:
# Wanted a more solid way to test validation resulted in correct errors
# other than matching strings;
# Decoupling the very notion of error from message
# Sideeffects:
# - Conventional way to namespace error translation by actual path
module Translatable
coreyhaines / .rspec
Last active Sep 4, 2019
Active Record Spec Helper - Loading just active record
View .rspec
-I app
View kill worker
set -u
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
You can’t perform that action at this time.