Skip to content

Instantly share code, notes, and snippets.

View wayneeseguin's full-sized avatar
🤪

Wayne E Seguin wayneeseguin

🤪
View GitHub Profile
#!/bin/bash
#
# Find all the rails projects from this directory down and clear their log
# files to save some space.
#
base=`pwd`
for path in `find $base -type f -path '*/config/environment.rb'` ; do
rails_root=`echo $path | xargs dirname | xargs dirname`
# rvm 'gemdir' function, easily switch between any ruby's gem directory.
function gemdir {
if [ -z "$1" ] ; then
echo "gemdir expects a parameter, which should be a valid rvm ruby selector"
else
rvm use $1
cd `rvm gemdir`
pwd
fi
}
#!/usr/bin/env ruby
compile '*' do
filter :erb
layout "default"
end
compile "/assets/stylesheets/*/" do
filter :sass
end
#!/usr/bin/env ruby
compile "/assets/css/*" do
filter :sass
end
route "/assets/css/*" do
item.identifier.sub(%r{/assets}, '').chop + '.css'
end
# Added small readability tweak
# input/output instead of pull/push
class TwoWayPipe
attr_reader :input, :output
def initialize
@input, @output = IO.pipe
end
end
Greg KH greg (at) kroah (dot) com 16 Nov 2005
A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
A: No.
Q: Should I include quotations after my reply?
# ~/.bash_profile
# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
export PATH="$HOME/bin:/usr/share/java/apache-ant/bin:/opt/java/bin:/usr/local/bin:/usr/local/sbin:$PATH"
export JAVA_HOME="/opt/java"
if [[ -s /home/dvyjones/.rvm/scripts/rvm ]] ; then source /home/dvyjones/.rvm/scripts/rvm ; fi
# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# This example shows how to setup an environment running Rails 3 (beta) + ripple (for riak) under ruby 1.9.1 with a 'riak' gem set.
∴ rvm update --head
# ((Open a new shell))
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.1
# Use the ruby + gem set
∴ rvm 1.9.1%riak