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
View jupyter_notebook_ec2.sh
#!/usr/bin/env bash
#Code adapted from https://gist.github.com/yangj1e/3641843c758201ebbc6c (Modified to Python3.5)
cd ~
#wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.4.0-Linux-x86_64.sh
wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.4.1-Linux-x86_64.sh
bash Anaconda3-2.4.1-Linux-x86_64.sh -b
echo 'PATH="/home/ubuntu/anaconda3/bin:$PATH"' >> .bashrc
. .bashrc
View # postgresql - 2016-12-08_20-57-24.txt
Homebrew build logs for postgresql on macOS 10.12.1
Build date: 2016-12-08 20:57:24