Skip to content

Instantly share code, notes, and snippets.

View inancgumus's full-sized avatar

İnanç Gümüş inancgumus

View GitHub Profile
# FOR AUTOMATIC SYNCING AWESOMENESS.
@inancgumus
inancgumus / installing-react-vr.sh
Last active March 21, 2017 11:52
downloads, installs and opens the sample page
#
# 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
@inancgumus
inancgumus / serializejson.go
Created June 6, 2017 12:23
Serialize (Marshall) JSON into a writable stream
package main
import (
"bufio"
"encoding/json"
"fmt"
"os"
)
func main() {
@inancgumus
inancgumus / mgoTestExample
Created June 16, 2017 11:31 — forked from laeshiny/mgoTestExample.go
mgo test example
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"time"
)
type Content struct {
@inancgumus
inancgumus / main.go
Last active July 5, 2017 11:46
Golang decorator pattern
package main
import (
"fmt"
)
type displayFunc func(s string)
func decorate(f displayFunc) displayFunc {
return func(s string) {
@inancgumus
inancgumus / Golang-binary-versioning.md
Created July 27, 2017 11:15 — forked from rafecolton/Golang-binary-versioning.md
Copypasta for easy versioning for your Go binaries

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!

@inancgumus
inancgumus / about.md
Created July 31, 2017 11:16 — forked from alexaandru/about.md
Minimal Golang web stack.

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.

@inancgumus
inancgumus / http-benchmark.md
Created July 31, 2017 14:39 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@inancgumus
inancgumus / sizeof.go
Created October 2, 2017 16:07
Go sizeof
package main
import (
"fmt"
"unsafe"
)
func main() {
var ageOfUniverse int
reservedBytes := unsafe.Sizeof(ageOfUniverse)
package main
import (
"fmt"
)
func main() {
// if it was: 14000000000 it'll overflow int on 32-bit machines
// using the scientific notation 14e9, elects the variable's type as
// a float64. because, the scientific-notation is defined for floating nums