Skip to content

Instantly share code, notes, and snippets.

# Status
git config --global alias.s 'status -s'
# List
git config --global alias.ls 'log --pretty=format:"%C(yellow)%h%C(red)%d %C(reset)%s %C(cyan) [%cn]" --decorate'
# List w/ date
git config --global alias.ld 'log --pretty=format:"%C(yellow)%h %ad%C(red)%d %C(reset)%s%C(cyan) [%cn]" --decorate --date=short'
# List w/ relative date
git config --global alias.lr 'log --pretty=format:"%C(yellow)%h %ad%C(red)%d %C(reset)%s%C(cyan) [%cn]" --decorate --date=relative'
# List w/ numstat
git config --global alias.ln 'log --pretty=format:"%C(yellow)%h%C(red)%d %C(reset)%s%C(cyan) [%cn]" --decorate --numstat'
@NatiAris
NatiAris / memoize.py
Created August 27, 2018 20:00
A simple decorator adding memoization to a function. Only works with positional arguments. Way too simplistic to have a limit on cache size, so be careful.
import functools
def memoize(outer_func):
"""Memoize everything."""
@functools.wraps(outer_func)
def inner_func(*args, _cache={}):
if args in _cache:
return _cache[args]
_cache[args] = outer_func(*args)
return _cache[args]

Info about grep / examples


Usage: grep [OPTION]... PATTERN [FILE]... (a few options / a few files can be passed at once)

Most used (by me):

Dealing with new stuff

First contact

  • Skim the about section of the [official website]
  • Read the related [wiki page] and introduction section of no more than one level of linked wiki pages
  • Google getting started with

Get familiar with the community