Skip to content

Instantly share code, notes, and snippets.

@Cyb3rNet
Cyb3rNet / git-prep.sh
Created July 9, 2010 19:39
git alias to initialize and create an initial GitHub repository
# git alias to initialize and create an initial GitHub repository
# git init
# touch README
# git add .
# git commit -m 'first commit'
# git remote add origin git@github.com:<account>/<name>
# git push origin master
git config --global alias.prep '!sh -c "echo \"GitHub Account:\"" && read ACCOUNT && echo "GitHub Repo Name:" && read REPONAME && mkdir $REPONAME && cd $REPONAME && git init && touch README.textile && git add . && git commit -m "first commit" && git remote add origin git@github.com:$ACCOUNT/$REPONAME.git && git push origin master'
# [alias]
# ignore = !([ ! -e .gitignore ] && touch .gitignore) | echo $1 >>.gitignore
git config --global alias.ignore '!([ ! -e .gitignore ] && touch .gitignore) | echo $1 >>.gitignore'
#!/bin/sh
# Searches for the argument as a file name accross the file system returning the file name found
mdfind $1 | xargs -0 basename
// got object id (page, user, etc.)
// connect to facebook
// get notes on object id
// foreach note
// get subject
@Cyb3rNet
Cyb3rNet / gist:434131
Created June 11, 2010 06:33
My github project init
git init
touch README
git add .
git commit -m 'first commit'
#git remote add origin git@github.com:<account>/<name>
#git push origin master
// In CodeIgniter 1.7.2
// - The controller
// o Loading my Css library
// ----------------------------
$this->load->library( 'css' );
// - The view
// o In constructor
// - Get CodeIgniter instance
// ------------------------------
// In CodeIgniter 1.7.2
// - The controller
// o Loading my Xhtml library
// ----------------------------
$this->load->library( 'xhtml' );
// - The view
// o In constructor
// - Get CodeIgniter instance
// ------------------------------
@Cyb3rNet
Cyb3rNet / .gitconfig-ignore
Created April 6, 2010 18:05
gitconfig-ignore
[alias]
ignore = !([ ! -e .gitignore ] && touch .gitignore) | echo $1 >>.gitignore
@Cyb3rNet
Cyb3rNet / git-make.sh
Created April 3, 2010 14:08
git make
git config --global alias.make '!sh -c "echo \"Project:\" && read PROJECT && mkdir $PROJECT && cd $PROJECT && git init && touch README.md && git add README.md && git commit -m \"Initial commit\" && git remote add git@github.com:Cyb3rNet/$PROJECT.git && git push origin master"'
@Cyb3rNet
Cyb3rNet / git-prompt.eh
Created April 1, 2010 00:43
Practical prompt with git integration
# Prompt
# ######
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[git:\1]/'
}
export PS1=" \n\[\e[;32m\]$ \[\e[;33m\]\d \t \[\e[1;35m\] \$(parse_git_branch) \n\[\e[;32m\]$ \[\e[1;31m\]\u\[\e[;32m\]@\H \[\e[0;34m\]\w\[\e[;32m\]\n$ \[\e[m\]"