Skip to content

Instantly share code, notes, and snippets.

@zivni
zivni / aliases.sh
Last active September 24, 2019 10:13
some useful git aliases
git config --global alias.alias "config --get-regexp ^alias\."
git config --global alias.incoming '!git fetch && git log --pretty=format:"%C(yellow)%h\\ %ad\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short ..$1'
git config --global alias.mincoming '!git fetch && git log ..origin/master'
git config --global alias.outgoing 'cherry -v'
git config --global alias.l 'log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short'
git config --global alias.master 'checkout master'
git config --global alias.graph 'log --oneline --abbrev-commit --all --graph --decorate --color'
git config --global alias.view 'show --oneline --name-status'
git config --global alias.mine '!git log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short | grep -F $(git config user.name) | less -r'
@zivni
zivni / InstanceMapReducerEnhancers.ts
Created July 25, 2016 06:32
Redux reducer enhancer to store specific control instance state by key
/**
* Use this reducer enhancer to store specific control instance state by key.
* The key will be resolved using the controlInstanceKeyResolver function parmeter which defaults to use the controlInstanceKey member of the action's meta object (i.e action.meta.controlInstanceKey)
* If the key is not a string then the action will be ignored and will not pass to the enhanched reducer.
* @param {function} reducer - the reducer to enhance
* @param {function} controlInstanceKeyResolver - an optional function to get the instance key from the action
*/
export function instanceMapReducerEnhancer(
reducer: Redux.Reducer,
controlInstanceKeyResolver: ((action) => string) = defaultKeyResolver) {
@zivni
zivni / InstanceMapReducerEnhancers.ts
Created July 25, 2016 06:32
Redux reducer enhancer to store specific control instance state by key
/**
* Use this reducer enhancer to store specific control instance state by key.
* The key will be resolved using the controlInstanceKeyResolver function parmeter which defaults to use the controlInstanceKey member of the action's meta object (i.e action.meta.controlInstanceKey)
* If the key is not a string then the action will be ignored and will not pass to the enhanched reducer.
* @param {function} reducer - the reducer to enhance
* @param {function} controlInstanceKeyResolver - an optional function to get the instance key from the action
*/
export function instanceMapReducerEnhancer(
reducer: Redux.Reducer,
controlInstanceKeyResolver: ((action) => string) = defaultKeyResolver) {