Skip to content

Instantly share code, notes, and snippets.

@cryptix
cryptix / joinedScan.go
Created February 6, 2014 13:22
Scaning Complex SQL Query results into multiple objects (better relation loading)
package main
import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
"log"
)
const sqlConf = "root:root@tcp(localhost:3306)/testJoinScan"
@cryptix
cryptix / keybase.md
Created April 12, 2014 14:08
Keybase proove

Keybase proof

I hereby claim:

  • I am cryptix on github.
  • I am cryptix (https://keybase.io/cryptix) on keybase.
  • I have a public key whose fingerprint is FD14 3DF5 8E62 AB23 421D EAE5 8D7D 5D44 0B9F 6E26

To claim this, I am signing this object:

@cryptix
cryptix / 1.xyz
Created April 23, 2014 10:32
cznic/ql ql.chunk error
0.0000 169.4456 -248.4184
0.0000 169.4412 -248.4166
0.0000 169.4411 -248.4100
0.0000 169.4363 -248.4091
0.0000 169.4333 -248.4034
0.0000 169.4315 -248.4015
0.0000 169.4271 -248.3997
0.0000 169.4237 -248.3950
0.0000 169.4212 -248.3950
0.0000 169.4178 -248.3903
@cryptix
cryptix / main.go
Last active August 29, 2015 14:00
Martini Route/Render TemplateFuncs issue
package main
import (
"github.com/go-martini/martini"
"github.com/martini-contrib/render"
"html/template"
)
var templateFuncs = template.FuncMap{
// define an empty stub first, otherwise html/template will complain with "missing function"
@cryptix
cryptix / seekTest.go
Last active August 29, 2015 14:01
"not found" when using gridfile as io.WriteSeeker
package main
import (
"fmt"
"io"
"os"
"labix.org/v2/mgo"
)
@cryptix
cryptix / runner.go
Created May 26, 2014 17:57
Copying binary ints to a c programm using golangs encoding/binary
package main
import (
"bufio"
"encoding/binary"
"fmt"
"io"
"os"
"os/exec"
"runtime"
@cryptix
cryptix / gist:b428b8cfce27e22f4e19
Created June 10, 2014 18:11
gopherjs utf8 issue
We couldn’t find that file to show.
@cryptix
cryptix / index.html
Created June 10, 2014 18:23
GopherJS utf8 encoding problem
<html>
<head>
<meta charset="utf-8">
<title>test</title>
</head>
<script src="main.js"></script>
<script>
function mkListInJs (id) {
var div = document.getElementById(id);
var ul = document.createElement("ul");
@cryptix
cryptix / Dockerfile
Created June 13, 2014 10:00
postgres docker image
# DOCKER-VERSION 1.0.0
FROM postgres:9.3
# install extensions thanks @georged
RUN cd contrib/pgcrypto && make && make install
ADD . /schemaSetup
# try to statup db.. blocks... :/
@cryptix
cryptix / repro.go
Created July 24, 2014 09:04
rice doesn't find cmds where a const is used
package main
import (
"fmt"
"github.com/GeertJohan/go.rice"
)
const weirdTmp = "/tmp/weird"