Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block junftnt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
junftnt / main.go
Created Sep 3, 2019 — forked from zupzup/main.go
Example for Basic AST Traversal in Go
View main.go
package main
import (
junftnt / unmarshal_interface.go
Created Aug 30, 2019 — forked from tkrajina/unmarshal_interface.go
Unmarshal JSON to specific interface implementation
View unmarshal_interface.go
package main
import (
type Something interface{}
junftnt / chat.go
Created Aug 28, 2019 — forked from drewolson/chat.go
simple golang chat server
View chat.go
package main
import (
type Client struct {
incoming chan string
outgoing chan string
junftnt /
Created Aug 28, 2019 — forked from kachayev/
Channels Are Not Enough or Why Pipelining Is Not That Easy
junftnt /
Created Aug 27, 2019 — forked from hgfischer/
Benchmarking Nginx with Go

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
junftnt / hello.c
Created Aug 22, 2019 — forked from tbelaire/hello.c
A small concurrent C example
View hello.c
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
// Small channel library here.
// It mimics unbuffered Go channels.
typedef struct chan_int {
int message;
junftnt /
Created Aug 22, 2019 — forked from jlblancoc/
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

junftnt /
Created Aug 22, 2019 — forked from Ouroboros/
How to install latest clang (5.0) on Ubuntu 16.04 (xenial) / WSL
wget -O - | sudo apt-key add -
sudo apt-add-repository "deb llvm-toolchain-xenial-5.0 main"
sudo apt-get update
sudo apt-get install -y clang-5.0 lld-5.0
wget -O - | sudo apt-key add -
sudo apt-add-repository "deb llvm-toolchain-xenial-6.0 main"
junftnt / multivalChSample.go
Created Aug 2, 2019 — forked from slav/multivalChSample.go
Golang sending sending multiple values through channel
View multivalChSample.go
package main
import "fmt"
func f(c chan func() (int, string)) {
c <- (func() (int, string) { return 0, "s" })
func main() {
c := make(chan func() (int, string))
junftnt / aes-256-gcm.go
Created Aug 1, 2019 — forked from cannium/aes-256-gcm.go
golang aes-256-gcm
View aes-256-gcm.go
package main
import (
You can’t perform that action at this time.