Skip to content

Instantly share code, notes, and snippets.

View adambabik's full-sized avatar

Adam Babik adambabik

View GitHub Profile
@adambabik
adambabik / android_emulator.sh
Created November 7, 2017 16:25
This is a way to start an Android emulator
# get list of emulators
android list avd
# start a selected emulator
cd ~/Library/Android/sdk/tools
./emulator -avd Nexus_5X_API_23
@adambabik
adambabik / merge.go
Created December 6, 2016 11:16
Go Maps Merge
package main
import "reflect"
// CopyOmmitedKeys copies only keys from the source which do not exist in dest.
func CopyOmmitedKeys(dest, source map[string]interface{}) {
leftV, rightV := reflect.ValueOf(dest), reflect.ValueOf(source)
leftKeysV, rightKeysV := leftV.MapKeys(), rightV.MapKeys()
leftKeysSet := map[string]bool{}
@adambabik
adambabik / .gitconfig
Last active February 5, 2016 11:34
Favourite git aliases
[alias]
l = log --graph --full-history --all --color \
--pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"
s = status
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
co = checkout
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
Number.prototype.putZero = function() {
if (this >= 0 && this < 10) {
return '0' + this;
} else {
return this;
}
};
Date.prototype.toISO8601 = function () {
var _date = {