Skip to content

Instantly share code, notes, and snippets.

View ardan-bkennedy's full-sized avatar

William Kennedy ardan-bkennedy

View GitHub Profile
type Query struct {
Raw string
Named *sqlx.NamedStmt
}
func (q *Query) Build(db *sqlx.DB) error {
var err error
q.Named, err = db.PrepareNamed(q.Raw)
return nil
}
// Package mongo provides support for accessing and executing commands against
// a mongoDB database
package mongo
import (
"encoding/json"
"fmt"
"strings"
"time"
@ardan-bkennedy
ardan-bkennedy / allocation_challenge
Created August 21, 2014 13:11
Go Allocation Challenge
// Created by Bill Hathaway to see if line 16 would produce an
// allocation in Go v1.3
package main
import (
"testing"
)
var (
m = make(map[string]struct{})
@ardan-bkennedy
ardan-bkennedy / Carbon.xml
Last active August 29, 2015 13:59
LiteIDE Theme
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme version="1.0" name="Carbon">
<!--
By William Kennedy
Improvements are welcome
Public Domain, Ardan Studios, 2014
Navigate To: /Applications/LiteIDE.app/Contents/Resources/liteeditor
Create a new file with the content.
Restatr LiteIDE
@ardan-bkennedy
ardan-bkennedy / GoMgoSample-1.go
Last active February 27, 2021 08:31
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {