Skip to content

Instantly share code, notes, and snippets.

Add following lines in section [alias] your git config file (~/.gitconfig).
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lg2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit
lg = !"git lg1"
Now you can use $ git lg $ git lg1 or $ git lg2 to get really fancy git logs.
@dimp-pl
dimp-pl / gist:3379406
Created August 17, 2012 14:50
How to make git ignore file changes?
# Fortunately GIT has a very easy solution for this, just run the following command on the file or path you want to ignore the changes of:
$ git update-index --assume-unchanged <file>
# If you wanna start tracking changes again run the following command:
$ git update-index --no-assume-unchanged <file>
@dimp-pl
dimp-pl / p26.erl
Created August 8, 2012 12:22
Erlang, combinations generation. Problem #26 of 99 %LANGUAGE_NAME problems.
-module(p26).
-export([combinations/2]).
% Generates all combinations of List by length Of
% Antilex order
combinations(List, Of) when List == []; Of == 0 ->
[];
combinations(List, Of) ->
Mask = vallist(length(List), 0),
@dimp-pl
dimp-pl / life.rb
Created July 23, 2012 19:52
Conway's Game of Life in Ruby
require 'matrix'
class Matrix
def []=(i, j, x)
@rows[i][j] = x
end
end
class GameOfLife
def initialize(row, col)