Skip to content

Instantly share code, notes, and snippets.

View artgillespie's full-sized avatar
🎯
Focusing

Art Gillespie artgillespie

🎯
Focusing
View GitHub Profile
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 {
@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"
},
@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 / .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 / keybase.md
Last active December 14, 2016 21:40
keybase verification

Keybase proof

I hereby claim:

  • I am artgillespie on github.
  • I am artgillespie (https://keybase.io/artgillespie) on keybase.
  • I have a public key ASArf7vE484J64Md1HcCDqROgYUKX_bYCD_NGyygCXGZSgo

To claim this, I am signing this object:

@artgillespie
artgillespie / app.js
Created February 28, 2015 02:44
Integrating socket.io with Express.js sessions.
/*jslint unparam:true, node:true*/
'use strict';
var express = require('express'),
session = require('express-session'),
cookie = require('cookie'),
cookieParser = require('cookie-parser');
var app = express();
@interface MyClass()
void ThisIsObviouslyNotAnObjectiveCMethod(const char *someParam, int someOtherParam);
@end
@implementation MyClass
void ThisIsObviouslyNotAnObjectiveCMethod(const char *someParam, int someOtherParam) {
// some code that doesn't even have access to MyClass instance as `self`
int max;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
dispatch_async(dispatch_get_main_queue(), ^{
// do your UI shizzle in here, yo...
}