View http-benchmark.md
View about.md

Mini Go Web Stack

Description

This represents a proof of concept, minimal web stack. I used http://nicolasmerouze.com/build-web-framework-golang/ series of articles as a starting point and the goal was to keep the stack as minimal as possible while still being useful for practical purposes. And of course, use the standard library as much as possible and only integrate components compatible with it.

View Golang-binary-versioning.md

Golang Binary Versioning Trick

To use, place the code in version_trick.go in your project. Don't forget to change the namespace to match yours to the actual name of your package.

In addition to version_trick.go, there's a makefile-snippet, that includes the secret sauce for making this trick work. Be sure to change the package name there as well.

Enjoy!

P.S. Special thanks to @meatballhat by way of @syscomet for showing me this trick!

View main.go
package main
import (
"fmt"
)
type displayFunc func(s string)
func decorate(f displayFunc) displayFunc {
return func(s string) {
View mongoDao
package dao
import (
"gopkg.in/mgo.v2/bson"
"time"
"gopkg.in/mgo.v2"
"strings"
"log"
)
View mgoTestExample
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"time"
)
type Content struct {
View serializejson.go
package main
import (
"bufio"
"encoding/json"
"fmt"
"os"
)
func main() {
View exercise_18_slices_pic_show.go
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
p := make([][]uint8, dy)
for y := range p {
p[y] = make([]uint8, dx)
for x := 0; x < dx; x++ {
p[y][x] = uint8(x^y)
View xmlToJson.xslt
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8"/>
<xsl:template match="/*[node()]">
<xsl:text>{</xsl:text>
<xsl:apply-templates select="." mode="detect" />
<xsl:text>}</xsl:text>
</xsl:template>
View installing-react-vr.sh
#
# run me by typing this:
#
# bash <(curl -s https://gist.githubusercontent.com/inancgumus/478ac54e68091cfdc2a088ceece21a66/raw/4220d45c3e9c15bbabc596c0d086b32be3416cbe/installing-react-vr.sh)
#
curl https://s3.amazonaws.com/static.oculus.com/reactvr/React_VR_Prerelease.zip
unzip React_VR_Prerelease.zip && mv preview react-vr && rm -f React_VR_Prerelease.zip