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
# | |
# NOTE: You may require ~/.rvm/lib/rvm after adding ~/.rvm/lib to the load path $: | |
# OR 'gem install rvm' and require the RVM API as a gem! | |
# | |
require "rvm" | |
results = [] | |
# | |
# Iterate over an RVM Environment object for each interpreter |
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
# System-wide .bashrc file for interactive bash(1) shells. | |
if [ -z "$PS1" ]; then | |
: # no-op | |
fi | |
PS1='\h:\W \u\$ ' | |
# Make bash check its window size after a process completes | |
shopt -s checkwinsize | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. |
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
function rvmised_prompt { | |
n_cols=$(tput cols) | |
rvm_prompt="$(rvm-prompt)" | |
let rvm_ppos=$n_cols-${#rvm_prompt} | |
tput sc # save cursor | |
tput cuf $rvm_ppos; tput setaf 1 # right justified and in red | |
echo -n $rvm_prompt | |
tput sgr0 # may not always work as expected | |
tput rc # restore cursor |
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
This is a pet project of mine called Twidget. The idea is to make selling random stuff you have SUPER easy and social. I basically hate Craigslist and eBay for selling stuff as I find them to be a pain in the ass. I have a closet full of crap that I literally want to snap a picture of and hope someone offers me money. That's twidget. | |
The app is mostly mobile. Here are the main features: | |
- A user registers or logs on via Facebook or Twitter. They are prompted to add the other one after registering (i.e. if you use FB after registering it prompts you to connect Twitter and vice versa) | |
- Once logged in the user have THREE options - sell, buy or promote. The default is the sell screen, which is just a camera (See below). | |
- SELL - user can take a picture of anything. They are then prompted for a title, price and location (based on a geo-location API, like foursquare). They can also post an optional description. Price defaults to $5.00. When they hit SELL IT it gets posted to their facebook and/or t |
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
group :development do | |
if RUBY_VERSION =~ /1.9/ | |
gem "ruby-debug19" | |
else | |
gem "ruby-debug" | |
fi | |
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
#!/bin/bash | |
banner() | |
{ | |
printf ' | |
______________________________________________ | |
| _____ ____ _ _ | | |
| | ____|__ _ ___ _ _ | _ \ __ _(_) |___ | | |
| | _| / _` / __| | | | | |_) / _` | | / __| | | |
| | |__| (_| \__ \ |_| | | _ < (_| | | \__ \ | |
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
I wrote a bash git-install script. Toward the end, I do: | |
echo "Edit ~/.bash_profile to load ~/.git-completioin.bash on Terminal launch" | |
echo "source ~/.git-completion.bash" >> ~/.bash_profile | |
The problem is, if you run the script more than once, you end up appending this line multiple times to ~/.bash_profile. How do I use bash scripting with grep or sed (or another option you may recommend) to only add the line if it doesn't yet exist in the file. Also, I want to add the line to ~/.profile if that file exists and ~/.bash_profile doesn't exist, otherwise just add it to ~/.bash_profile. |
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
Original code from: | |
http://www.wezm.net/technical/2009/05/exclude-directories-from-textmate-side-bar-for-faster-find-in-project/ |
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
my_chpwd() | |
{ | |
if [[ -s "$PWD/set_env" ]] ; then | |
source "$PWD/set_env" | |
echo '(automatically sourced set_env)' | |
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
#Shouldn't that be more this? | |
# curl https://github.com/wayneeseguin/rvm/raw/master/scripts/install | grep -v '^#' | |
set -o errtrace | |
export PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }' | |
if [[ -z "$rvm_selfcontained" ]]; then | |
if [[ $(id | sed -e 's/(.*//' | awk -F= '{print $2}') -eq 0 || \ |