Skip to content

Instantly share code, notes, and snippets.

View soulcutter's full-sized avatar

Bradley Schaefer soulcutter

View GitHub Profile
@JoshCheek
JoshCheek / routes
Created May 4, 2018 17:50
Cache / filter / reformat filtered routes since `rake routes` is so expensive.
#!/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
@smcabrera
smcabrera / .vimrc
Last active November 15, 2016 17:21
Some sensible defaults for a .vimrc
"============================================================
"== Vundle Plugin Manager
"============================================================
"found here: https://github.com/VundleVim/Vundle.vim
set rtp+=~/.config/nvim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
"============================================================
"== Plugins: Sensible Defaults
@benwalsh
benwalsh / gist:0e3fa2276ffe2f03fef5
Created May 14, 2015 17:24
Capistrano for manifests
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 }"
end
desc "Upload the asset manifest file"
@xaviershay
xaviershay / build_frontend.sh
Last active December 24, 2015 20:49
SASS + Coffee + Concatenation in prod
#!/bin/bash
set -exo pipefail
BUILD_ENV=$1
if [ `uname` == 'Darwin' ]; then
OSX=1
JSCOMPRESSOR="yuicompressor --type js"
else
OSX=
@idrozd
idrozd / translatable.rb
Created July 19, 2013 08:09
Ruby Translatable
# 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
coreyhaines / .rspec
Last active April 11, 2024 00:19
Active Record Spec Helper - Loading just active record
--colour
-I app
#!/bin/sh
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:
APP_ROOT=/k/app_name/current
PID=/var/run/unicorn/unicorn.pid
ENV=production