This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Added small readability tweak | |
# input/output instead of pull/push | |
class TwoWayPipe | |
attr_reader :input, :output | |
def initialize | |
@input, @output = IO.pipe | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
export PS1='\h:\w\$ ' | |
umask 022 | |
# You may uncomment the following lines if you want `ls' to be colorized: | |
# export LS_OPTIONS='--color=auto' | |
# eval "`dircolors`" | |
# alias ls='ls $LS_OPTIONS' | |
# alias ll='ls $LS_OPTIONS -l' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Merge conflict check. | |
if grep -iR "<<<<<<" ./* || grep -iR ">>>>>" ./* ; then | |
echo "\nERROR:\nYou have merge conflicts. \nPlease resolve them and try again.\n" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Correct | |
My .bash_profile::: | |
<< Heap of stuff from default ubuntu install that was under the &&return line>> | |
# Be sure all paths / environment setup before sourcing RVM | |
#RVM | |
if [[ -s /home/steve/.rvm/scripts/rvm ]]; then | |
source /home/steve/.rvm/scripts/rvm ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switch to Ruby 1.8.7 | |
rvm use 1.8.7 | |
# Print out the ruby version | |
ruby -v | |
# But the output of this is: | |
# | |
# $ ./tryrvm | |
# <i> Now using ruby 1.8.7 p249 </i> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Final Countdown | |
# config.middleware.use Roll | |
class Roll | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
request = Rack::Request.new(env) | |
ip = request.ip |
OlderNewer