Skip to content

Instantly share code, notes, and snippets.

View wayneeseguin's full-sized avatar
🤪

Wayne E Seguin wayneeseguin

🤪
View GitHub Profile
@wayneeseguin
wayneeseguin / .rvmrc
Created October 29, 2010 00:45 — forked from anonymous/.rvmrc
#!/usr/bin/env bash
# Remove from .gitignore and check this into your repo!!!
if [[ "Linux" = "$(uname)" ]] ; then
# Production
gemset_name="mindworx"
else
# Development
gemset_name="othergemsetname"
tar jxf bdsm-0.0.6.tar.bz2
cd bdsm-0.0.6
sudo ./install
sudo -i -u test
bdsm bdsmrc
Name: Wayne E. Seguin
Email: wayneeseguin@gmail.com
url: http://rvm.beginrescueend.com/
Mike,
Forums and blog posts are not the place to discuss features and bugs, but rather by joining #rvm in irc.freenode.net during the daytime EDT and work it out with me in *real time*.
Yes this is in opposition to some time lagged forum / email thread that will be outdated and mislead users in the future who think it is the most recent on the topic (There IS a community google group for the community by the community for RVM, however IRC is the proper means of communication for RVM).
@wayneeseguin
wayneeseguin / gist:674648
Created November 12, 2010 20:47
Simple example of using the RVM Ruby API
#
# 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
@wayneeseguin
wayneeseguin / bashrc
Created November 23, 2010 20:38 — forked from orlandolopez/bashrc
# 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.
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 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
@wayneeseguin
wayneeseguin / gist:733937
Created December 8, 2010 21:23
Selecting based on Ruby Version
group :development do
if RUBY_VERSION =~ /1.9/
gem "ruby-debug19"
else
gem "ruby-debug"
fi
end
@wayneeseguin
wayneeseguin / gist:737153
Created December 11, 2010 04:45
RVM bootstrapping script for Jeffa
#!/bin/bash
banner()
{
printf '
______________________________________________
| _____ ____ _ _ |
| | ____|__ _ ___ _ _ | _ \ __ _(_) |___ |
| | _| / _` / __| | | | | |_) / _` | | / __| |
| | |__| (_| \__ \ |_| | | _ < (_| | | \__ \ |
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.