Skip to content

Instantly share code, notes, and snippets.

@cakyus
cakyus / git-alias.txt
Created March 23, 2014 13:37
git alias
alias.c=commit -m
alias.b=branch -v
alias.r=remote -v
alias.s=status -s
alias.a=add -A
alias.ba=branch --verbose --all
alias.la=log --graph --pretty=format:"%Cred%h%Creset%C(yellow)%d%Creset %s - %aE %Cgreen%cr%Creset" --abbrev-commit
alias.l=log -n10 --graph --pretty=format:"%Cred%h%Creset%C(yellow)%d%Creset %s - %Cblue%aE%Creset %Cgreen%cr%Creset" --abbrev-commit
alias.xa=stash apply
alias.l1=log -n 1
@cakyus
cakyus / .gitignore
Last active December 20, 2015 14:19
Bash Scripts Collection
make*
@cakyus
cakyus / gist:3899126
Created October 16, 2012 13:00
Example of Singleton Pattern
class classB {
private static $instance;
private $count = 0;
private function __construct() {}
static function functionB() {
if (!isset(self::$instance)) {
$className = __CLASS__;
self::$instance = new $className;
}
return self::$instance;
@cakyus
cakyus / gist:3899122
Created October 16, 2012 12:59
Example of Static Variable
class classA {
function functionA() {
static $variableA;
if (is_null($variableA)) {
$variableA = 0;
} else {
$variableA++;
}
return $variableA;
}