This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number.prototype.putZero = function() { | |
if (this >= 0 && this < 10) { | |
return '0' + this; | |
} else { | |
return this; | |
} | |
}; | |
Date.prototype.toISO8601 = function () { | |
var _date = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get list of emulators | |
android list avd | |
# start a selected emulator | |
cd ~/Library/Android/sdk/tools | |
./emulator -avd Nexus_5X_API_23 | |