Skip to content

Instantly share code, notes, and snippets.

@barron9
barron9 / go-nginx.md
Created Jul 6, 2021 — forked from yosssi/go-nginx.md
Go networking performance vs Nginx
View go-nginx.md

1. Nginx

$ wrk -t12 -c400 -d2s http://127.0.0.1:8080
Running 2s test @ http://127.0.0.1:8080
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.71ms    3.16ms  23.05ms   69.17%
    Req/Sec     3.44k     1.98k    7.80k    58.22%
  63697 requests in 2.00s, 17.86MB read
@barron9
barron9 / golang-tls.md
Created Jul 4, 2021 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
View golang-tls.md

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@barron9
barron9 / main.go
Created Jul 4, 2021 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@barron9
barron9 / RXLookingGlass.cs
Created May 2, 2021 — forked from MattRix/RXLookingGlass.cs
This class wraps an internal Unity method that lets you to check if a ray intersects a mesh. Place it in an Editor folder.
View RXLookingGlass.cs
using UnityEngine;
using UnityEditor;
using System.Collections;
using System;
using System.Linq;
using System.Reflection;
[InitializeOnLoad]
public class RXLookingGlass
{
View AudioManager.cs
using System;
using System.Runtime.InteropServices;
// ReSharper disable SuspiciousTypeConversion.Global
// ReSharper disable InconsistentNaming
namespace VideoPlayerController
{
/// <summary>
/// Controls audio using the Windows CoreAudio API
/// from: http://stackoverflow.com/questions/14306048/controling-volume-mixer
@barron9
barron9 / iller.json
Last active Jul 5, 2019 — forked from serong/iller.json
JSON formatında Türkiye'nin illeri.
View iller.json
{"01":"ADANA","02":"ADIYAMAN","03":"AFYONKARAHİSAR","04":"AĞRI","05":"AMASYA","06":"ANKARA","07":"ANTALYA","08":"ARTVİN","09":"AYDIN","10":"BALIKESİR","11":"BİLECİKK","12":"BİNGÖL","13":"BİTLİS","14":"BOLU","15":"BURDUR","16":"BURSA","17":"ÇANAKKALE","18":"ÇANKIRI","19":"ÇORUM","20":"DENİZLİ","21":"DİYARBAKIR","22":"EDİRNE","23":"ELAZIĞ","24":"ERZİNCAN","25":"ERZURUM","26":"ESKİŞEHİR","27":"GAZİANTEP","28":"GİRESUN","29":"GÜMÜŞHANE","30":"HAKKARİ","31":"HATAY","32":"ISPARTA","33":"MERSİN","34":"İSTANBUL","35":"İZMİR","36":"KARS","37":"KASTAMONU","38":"KAYSERİ","39":"KIRKLARELİ","40":"KIRŞEHİR","41":"KOCAELİ","42":"KONYA","43":"KÜTAHYA","44":"MALATYA","45":"MANİSA","46":"KAHRAMANMARAŞ","47":"MARDİN","48":"MUĞLA","49":"MUŞ","50":"NEVŞEHİR","51":"NİĞDE","52":"ORDU","53":"RİZE","54":"SAKARYA","55":"SAMSUN","56":"SİİRT","57":"SİNOP","58":"SİVAS","59":"TEKİRDAĞ","60":"TOKAT","61":"TRABZON","62":"TUNCELİ","63":"ŞANLIURFA","64":"UŞAK","65":"VAN","66":"YOZGAT","67":"ZONGULDAK","68":"AKSARAY","69":"BAYBURT","70":"KARAM