Skip to content

Instantly share code, notes, and snippets.

@cryptix
cryptix / runner.go
Created August 13, 2014 13:31
runnableSim
package main
import (
"bufio"
"fmt"
"log"
"os"
"runtime"
)
@cryptix
cryptix / new.go
Last active August 29, 2015 14:04
Java>Go PSHDL Simulator
package SimpleAlu
type regUpdate struct {
internal, offset int
}
type SimpleAluGenerator struct {
varIdx map[string]int
regUpdates []regUpdate
@cryptix
cryptix / client.go
Created July 30, 2014 11:45
sharing filedescriptors through unix sockets
package main
import (
"math/rand"
"net"
"github.com/cryptix/goremutake"
"github.com/ftrvxmtrx/fd"
)
@cryptix
cryptix / main.go
Created July 29, 2014 10:16
using go/ast to find specific function calls and the values of a parameter
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
"log"
)
@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"
@cryptix
cryptix / client.go
Created June 22, 2014 11:09
multipart upload with io.Pipe
package main
import (
"io"
"log"
"mime/multipart"
"net/http"
"os"
"path/filepath"
"runtime"
@cryptix
cryptix / fotos.go
Created June 15, 2014 16:03
revel image upload example
package controllers
import (
"bytes"
"image"
"image/gif"
"image/jpeg"
"image/png"
"io"
"net/http"
@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 / 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 / gist:b428b8cfce27e22f4e19
Created June 10, 2014 18:11
gopherjs utf8 issue
We couldn’t find that file to show.