Skip to content

Instantly share code, notes, and snippets.

View rymawby's full-sized avatar

Ry Mawby rymawby

View GitHub Profile
@rymawby
rymawby / apply-git-stash.sh
Created June 25, 2013 13:01
Apply git stash
# where n is the number supplied in
git stash list
git stash apply stash@{n}
@rymawby
rymawby / git-workflow.sh
Last active December 8, 2016 23:20
Git workflow
# Create a development branch
# Typically, branch from the current sprint branch:
git fetch
git checkout SPRINT_XX
git pull origin SPRINT_XX
git checkout -b <BRANCH_NAME>
# Make atomic commits
git add .
/**
* User: tom
* Date: 14/05/12
* Time: 14:46
*/
package {
import org.osflash.signals.Signal;
import flash.events.TimerEvent;
import flash.utils.Timer;
@rymawby
rymawby / oh-my-zsh-git-cheatsheet.sh
Created June 27, 2013 11:39
Handy cheatsheet for the git plugin for oh-my-zsh. Taken from https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet.
# Dynamic access to current branch name with the current_branch function
git pull origin $(current_branch)
grb publish $(current_branch) origin
# Helpful aliases for common git tasks
g # git
gst # git status
gl # git pull
gup # git fetch && git rebase
gp # git push
@rymawby
rymawby / checking-out-a-remote-branch.sh
Created June 28, 2013 08:41
Checking out a remote branch with git
git fetch origin
git checkout -b <BRANCH_NAME> origin/<BRANCH_NAME>
@rymawby
rymawby / git-branch-commit-status.sh
Created July 1, 2013 10:42
Check what commits your local branches are on in git. (basically verbose)
git branch -v
@rymawby
rymawby / discard-local-changes.sh
Created July 1, 2013 13:51
Discard local changes in git.
git checkout -f
@rymawby
rymawby / rails-model-types.rb
Created July 3, 2013 21:46
Rails model types
:string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date,
:binary, :boolean, :references
@rymawby
rymawby / set-timestamp-on-model.rb
Created July 4, 2013 21:39
To set timestamp on a rails model
Model.find(id).timestamp_column = Time.now
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}