Skip to content

Instantly share code, notes, and snippets.

View murphysean's full-sized avatar

Sean Murphy murphysean

View GitHub Profile
@murphysean
murphysean / README.md
Last active July 25, 2018 04:49
CSV Code Challenge

CSV Code Challenge

Introduction

To get started run:

go get
go build
@murphysean
murphysean / main.go
Created February 7, 2016 21:58
Testing Two Factor Authentication In Go
package main
import (
"crypto/rand"
"fmt"
"net/http"
"text/template"
)
type User struct {
@murphysean
murphysean / sql-groovy-test.groovy
Created February 7, 2016 21:49
Testing SQL UTF-8 4 byte emoji
@GrabConfig( systemClassLoader=true )
@Grab( 'mysql:mysql-connector-java:5.1.38' )
import groovy.sql.Sql
class GroovySqlExample1{
static void main(String[] args) {
def sql = Sql.newInstance("jdbc:mysql://domovm.local.domo.com:3306/", "user","pass", "com.mysql.jdbc.Driver")
sql.eachRow("SHOW VARIABLES WHERE Variable_name LIKE 'character\\_set\\_%' OR Variable_name LIKE 'collation%';"){ row ->
println row.variable_name + " " + row.value
}
@murphysean
murphysean / uuid.go
Created October 21, 2015 21:40
Create a v4 UUID in go
package main
import(
"crypto/rand"
)
func GenUUIDv4() string {
u := make([]byte, 16)
rand.Read(u)
//Set the version to 4

Keybase proof

I hereby claim:

  • I am murphysean on github.
  • I am murphysean (https://keybase.io/murphysean) on keybase.
  • I have a public key whose fingerprint is 1FD8 25A1 F1DC 0132 2C29 E2FB 95ED 7F8B 5AA3 C119

To claim this, I am signing this object:

#include <Wire.h>
#define LIDARLite_ADDRESS 0x62 // Default I2C Address of LIDAR-Lite.
#define RegisterMeasure 0x00 // Register to write to initiate ranging.
#define MeasureValue 0x04 // Value to initiate ranging.
#define RegisterHighLowB 0x8f // Register to get both High and Low bytes in 1 call.
int reading = 0;
// the setup function runs once when you press reset or power the board
void setup() {
@murphysean
murphysean / main.go
Created December 13, 2014 20:50
Redis Importer
package main
import (
"flag"
"github.com/garyburd/redigo/redis"
"io/ioutil"
"log"
"time"
)
@murphysean
murphysean / main.go
Created December 13, 2014 19:28
go-json-schema
package main
import (
"fmt"
"github.com/xeipuuv/gojsonschema"
)
func main() {
schemaMap := map[string]interface{}{
@murphysean
murphysean / main.go
Created December 13, 2014 19:26
go-json-date
package main
import (
"encoding/json"
"fmt"
"reflect"
"time"
)
func main() {
@murphysean
murphysean / Dockerfile
Last active August 29, 2015 14:06
Go User MicroService
FROM ubuntu
MAINTAINER murphysean84@gmail.com
COPY . /app
# Install app dependencies
EXPOSE 8080
ENTRYPOINT ["/app/UserMicroService"]