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 / gist:2821603
Created May 28, 2012 23:12
Doorkeeper Error
Started GET "/oauth/authorize?client_id=aa957fb21e60fe301126c5abe244db5e965d23ea3a71d178834e9cda18a4ad9a&response_type=code&redirect_uri=http%3A%2F%2Fmydomain.com%3A4000%2Fauth%2Fmydomainmethod%2Fcallback&scope=" for 127.0.0.1 at 2012-05-28 23:02:04 +0000
Processing by Doorkeeper::AuthorizationsController#new as HTML
Parameters: {"client_id"=>"aa957fb21e60fe301126c5abe244db5e965d23ea3a71d178834e9cda18a4ad9a", "response_type"=>"code", "redirect_uri"=>"http://mydomain.com:4000/auth/mydomainmethod/callback", "scope"=>""}
Redirected to http://mydomain.com:4000/auth/mydomainmethod/callback?code=8e3aa21259fda1336c5a6fb8d042207755161b231b794c676b4d1595133cb6ad
Completed 302 Found in 35ms (ActiveRecord: 14.7ms)
Started POST "/oauth/token?client_id=aa957fb21e60fe301126c5abe244db5e965d23ea3a71d178834e9cda18a4ad9a&redirect_uri=http%3A%2F%2Fmydomain.com%3A4000%2Fauth%2Fmydomainmethod%2Fcallback&code=8e3aa21259fda1336c5a6fb8d042207755161b231b794c676b4d1595133cb6ad&client_secret=0a410804646338927aca5f0d0bc0551247d7b654
@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