Skip to content

Instantly share code, notes, and snippets.

@psdcoder
psdcoder / git-snippets.md
Last active February 27, 2019 09:28
GIT Snippets

Local

Sync local branches with remote

git remote prune origin

Remove merged branches

git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d

Run garbage collector

git gc

@psdcoder
psdcoder / timer
Last active December 15, 2015 15:39
Simple jQuery timer. Usage: $('#timer').timer( 10, //duration of timer function(el){ //callback which will executed when time is up el.text('time is up!'); } )
(function($){
$.fn.timer = function(duration, callback) {
var time = duration,
element = this;
element.text(time--);
var interval = setInterval(function() {
if(time < 0){
clearInterval(interval);
[user]
email = psdcoder@gmail.com
name = Pavel Grinchenko
[alias]
ci = commit
br = branch
co = checkout
df = diff
lg = log -p
st = status