Skip to content

Instantly share code, notes, and snippets.

@r3ap3r2004
r3ap3r2004 / docker-destroy.sh
Created December 29, 2016 18:11 — forked from steenzout/docker-destroy.sh
Bash script to wipe out all docker containers, volumes and network.
#!/bin/bash
docker stop $(docker ps -a -q)
docker rm -f $(docker ps -a -q)
docker volume prune -f
docker network prune -f
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@r3ap3r2004
r3ap3r2004 / .gitattributes
Created October 4, 2012 02:10 — forked from iloveitaly/.gitattributes
Snippets for Spree Commerce Development
# with my git configuration the spree repo was giving me issues with line endings
# this fixed the issue for me: marking a file as binary causes git to ignore it completely
core/vendor/assets/javascripts/jquery.alerts/jquery.alerts.css.erb binary
core/vendor/assets/javascripts/jquery.alerts/jquery.alerts.js binary
core/vendor/assets/javascripts/jquery.jstree/themes/apple/style.css binary
sample/db/sample/spree/line_items.yml binary
sample/db/sample/spree/products.yml binary
@r3ap3r2004
r3ap3r2004 / deploy.rb
Created May 16, 2012 03:55 — forked from uhlenbrock/deploy.rb
Precompile assets locally for Capistrano deploy
load 'deploy/assets'
namespace :deploy do
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
%x{bundle exec rake assets:precompile}
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}}
%x{bundle exec rake assets:clean}
end
@r3ap3r2004
r3ap3r2004 / gist:2108314
Created March 19, 2012 11:28 — forked from kbaum/gist:892247
prune_workers_from_terminated_instance.rb
module Resque
def self.unregister_workers_for_host(host)
Resque.workers.select{|worker| worker.id.split(':').first==host}.each(&:unregister_worker)
end
end
Resque.unregister_workers_for_host("ip-10-250-192-51")
@r3ap3r2004
r3ap3r2004 / track_rails_skeleton
Created March 14, 2012 01:06
TRACKS CHANGES TO RAILS' APP SKELETON SINCE A GIVEN VERSION
#!/usr/bin/env zsh
# 1304046900 TRACKS CHANGES TO RAILS' APP SKELETON SINCE A GIVEN VERSION
# To be placed in the root of your app.
old_version="3.1.3"
# Exit on failure
#
@r3ap3r2004
r3ap3r2004 / track_spree
Created March 14, 2012 01:06
TRACKS CHANGES TO PARTS OF SPREE SINCE A GIVEN COMMIT
#!/usr/bin/env zsh
# 1304046900 TRACKS CHANGES TO PARTS OF SPREE SINCE A GIVEN COMMIT
# To be placed in the root of your app.
old_commit="32483802d823e92c0746d080217870dd48f49307"
parts=(
core/app/assets/javascripts/store/checkout.js
@r3ap3r2004
r3ap3r2004 / bogo.rb
Created February 11, 2012 01:31 — forked from BDQ/bogo.rb
module Spree
class Calculator::Bogo < Calculator
preference :number_to_buy, :integer, :default => 1
preference :number_to_get, :integer, :default => 1
def self.description
"Buy One Get One"
end
def compute(order)
#!/bin/sh
## you'll have to do a couple extra steps to get this running
## there are probably other ways to handle svncanboot, but this is from the linux forum
set -e
if
touch /etc/_testr_file
then
@r3ap3r2004
r3ap3r2004 / git_track_rails_skeleton
Created January 1, 2012 16:43
TRACKS CHANGES TO RAILS' APP SKELETON SINCE A GIVEN VERSION
#!/usr/bin/env zsh
# 1304046900 TRACKS CHANGES TO RAILS' APP SKELETON SINCE A GIVEN VERSION
old_version="3.1.1"
# Exit on failure
#
set -e