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
## Run the following from your terminal ## | |
# Get git and curl and install rvm | |
sudo aptitude install curl git-core | |
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) | |
sed -i 's/^\[/# [/' ~/.bashrc | |
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc | |
source ~/.bashrc | |
# Next, install dependencies for compiling Ruby |
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/ruby | |
# I want to make this a class, but until I get all the | |
# bugs worked out it will just be a script :-) | |
#class Palindrome | |
def isPalindrome(string) | |
palindrome = true | |
reverse = string.reverse |
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
<?php | |
/** | |
* @author Eric Shelley <[email protected]> | |
*/ | |
class M20101208130030 extends CakeMigration | |
{ | |
/** | |
* Migration description | |
* | |
* @var string |
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
<?php | |
// Join example | |
$result = $this->Product->find('all', array( | |
'fields' => array( | |
'Product.name', | |
'ProductCategory.name' | |
), | |
'joins' => array( | |
array( |
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: http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# | |
# I've modified the prompt to be simple and clean; also, I colored the branch rather than the path | |
# ~/dev/dir[master]$ # clean working directory | |
# ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { |
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 parse_git_branch { | |
git_status="$(git status 2> /dev/null)" | |
pattern="^# On branch ([^${IFS}]*)" | |
if [[ ! ${git_status}} =~ "working directory clean" ]]; then | |
state="*" | |
fi | |
# add an else if or two here if you want to get more specific | |
if [[ ${git_status} =~ ${pattern} ]]; then | |
branch=${BASH_REMATCH[1]} |
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
# Store rake tasks specific to [company] | |
namespace :[company] do | |
# Migrate [Company]'s data into the new CRM | |
namespace :migrate do | |
require 'progressbar' | |
desc "Run all [company] migration tasks" | |
task :all => [:config, :users, :comments, :accounts] |
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/sh | |
# Show git status and branch | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
export PS1='\[\033[0m\]\w\[\033[1;33m\]$(parse_git_branch)\[\033[0m\]$ ' |
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/sh | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxCxDxBxegedabagacad | |
#showing git branches in bash prompt | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} |
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
# Custom bash scripts | |
export PATH=$PATH:~/bin | |
# AWS Settings | |
export AWS_HOME=~/.aws | |
export EC2_HOME=$AWS_HOME/cli_tools/ec2-api-tools | |
export AWS_AUTO_SCALING_HOME=$AWS_HOME/cli_tools/as-api-tools | |
export PATH=$PATH:$EC2_HOME/bin:$AWS_AUTO_SCALING_HOME/bin | |
export EC2_PRIVATE_KEY=$AWS_HOME/pk-ec2.pem | |
export EC2_CERT=$AWS_HOME/cert-ec2.pem |
OlderNewer