Skip to content

Instantly share code, notes, and snippets.

View artgillespie's full-sized avatar
🎯
Focusing

Art Gillespie artgillespie

🎯
Focusing
View GitHub Profile
@artgillespie
artgillespie / .block
Created May 26, 2017 18:49
fresh block
license: mit
@artgillespie
artgillespie / .block
Created May 26, 2017 18:49
fresh block
license: mit
@artgillespie
artgillespie / handy.sh
Created September 5, 2017 18:13
Branch maintenance
# display the oldest 25 branches based on most recent commit date that start with `art`
git for-each-ref --sort=committerdate --format="%(refname:short)%09'%(committerdate)'" --count=25 refs/heads/art
# delete the oldest 25 branches based on most recent commit date that start with `art`
git for-each-ref --sort=committerdate --format="%(refname:short)%09'%(committerdate)'" --count=25 refs/heads/art | cut -f 1 | xargs git branch -D
@artgillespie
artgillespie / data.json
Last active June 29, 2019 16:31
lib/pq CopyIn vs "naive" multi-insert benchmarks
[
{
"_id": "5d1773ebce1769292c25993c",
"time": "Wed Aug 09 1972 12:05:26 GMT+0000 (UTC)",
"index": 0,
"guid": "ba791989-fcf0-45b1-8129-4e655f1d4f10",
"temp": "76.56",
"humidity": "56.63",
"airq": "0.5137"
},
type DBJSONMap map[string]interface{}
// scanning a null column value is problematic how do we know that it was null?
// for structs, this is easy, we can just slap an IsNull field on it and set it
// in the Scanner, but for map[string]interface{} ...
func NewDBJSONMap() DBJSONMap {
return make(map[string]interface{})
}
func (d DBJSONMap) IsNull() bool {