Skip to content

Instantly share code, notes, and snippets.

View DAddYE's full-sized avatar

Davide D'Agostino DAddYE

  • Endor Labs
  • San Francisco
View GitHub Profile
@DAddYE
DAddYE / reload_bundler.rb
Created May 14, 2011 21:44
Reload Bundler
ENV['BUNDLE_GEMFILE'] = 'NewGemfile'
Bundler.send(:remove_instance_variable, :@setup)
Bundler.send(:remove_instance_variable, :@definition)
# Bundler.send(:remove_instance_variable, :@completed_groups)
Bundler.send(:remove_instance_variable, :@load)
Bundler.send(:remove_instance_variable, :@settings)
@DAddYE
DAddYE / update.sh
Created May 25, 2011 14:29
Update Gems, Update RubyGems, Fix warnings.
#!/usr/bin/env bash
sudo gem update
yes | sudo gem clean
sudo gem update --system
if [ ! -f /usr/local/bin/brew ]
then
ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"
fi
@DAddYE
DAddYE / ps_pretty.sh
Created July 6, 2011 14:51
PS with same output on darwin and unix
# There is a better way to separate output with \t?
ps axo pid,rss,pcpu,command | grep -vE "^USER|grep" | awk '{print $1"\t"$2"\t"$3"\t"$4" "$5" "$6}'
$ ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
$ brew install node
$ curl http://npmjs.org/install.sh | sh
$ npm install -g stylus
$ cd your_project
$ stylus -w public/stylesheets/*.styl -c
$ stylus -C public/stylesheets/foo.css
# or
$ stylus -C public/stylesheets/*.css
@DAddYE
DAddYE / rvm-empty-gems.sh
Created August 2, 2011 13:25
Fast way to empty global gemset
#!/bin/bash -e
for ruby in $(rvm list strings)
do
echo -e "\e[32m======================================================\e[0m"
echo -e "\e[32mUsing ruby \e[1m$ruby\e[0m"
echo -e "\e[32m======================================================\e[0m"
cmd="rvm $ruby exec ""echo yes | rvm gemset empty"""
echo "Cleaning $ruby gems"
echo -e $cmd; $cmd
echo