Skip to content

Instantly share code, notes, and snippets.

@gorenje
gorenje / gist:955379
Created May 4, 2011 15:09
bash alias for install cappuccino tool chain into a local directory
function _funct_capp_local_install
{
local dirname response
if ! git clone https://github.com/280north/cappuccino.git . ; then
echo "Current directory is not empty, a $0 will only work"
echo "in an empty directory."
return
fi
alias ß="rails s"
alias ç="rails c"
alias ®="rake routes"
@gorenje
gorenje / cd_bundle_to.bash
Created June 7, 2011 08:00
cd-bundle-to -- make it easy to jump to gem source
function _funct_cd_bundle_to() {
pushd $(bundle show $1)
}
alias cd-bundle-to=_funct_cd_bundle_to
@gorenje
gorenje / git_fetch_all.bash
Created June 7, 2011 10:22
bash alias for fetch all remote git repos
alias git-fetch-all="git remote | xargs -I % git fetch % && (git remote | xargs -I % git remote show %) | sed s'/* remote /################## /'g"
@gorenje
gorenje / commit-msg-goclone
Created June 7, 2011 11:29
commit-msg goes into .git/hooks/commit-msg (chmod 755)
#!/bin/sh
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
ref=${ref#refs/heads/}
# allow for branch names:
# tick12+12_fubar
# tick12+12-fubar_sd
# ticket12+12-fubar_sd
# ticket12+12+123-fubar_sd
# or tick(et) replaced by issue (redmine conform)
@gorenje
gorenje / *scratch*
Created June 8, 2011 10:15
git global config
[alias]
st = status
ci = commit
co = checkout
cp = cherry-pick
br = branch
lg = log
ms = merge --squash
rs = remote show
pish = push
@gorenje
gorenje / gitosis_init.bash
Created June 17, 2011 12:45
gitosis-init alias for creating new gitosis git repos
function _funct_gitosis_init {
## create a new remote repo once the gitosis conf has been updated
while getopts "h" option
do
case $option in
h)
echo "For example: gitosis-init [email protected]:username.git"
return
;;
esac
@gorenje
gorenje / .bash_aliases
Created June 30, 2011 16:51
git diffs for file-only and commits between branches
# arguments are: <branch1>..<branch2> is the argument
alias git-commit-diff="git log --pretty=oneline"
alias git-diff-commits=git-diff-commits
alias git-diff-file-names='git diff --name-status'
@gorenje
gorenje / find-rails.bash
Created November 4, 2011 09:43
bash alias for grep'ing all rails relevant files.
function _funct_find_rails
{
local app=""
local option=
local what=$*
local for_redmine=""
OPTIND=1
while getopts "a:ers:" option
do
#!/bin/bash
# not an original poem,
# no known author,
# no known copyright,
# aesthetics over originality?
_..() { .._ ${@//[tt]?[^s]/2};}
__.() { echo -ne $@' ' ;}
one() { __. '1' && _.. $@ ;}