Skip to content

Instantly share code, notes, and snippets.

View lyda's full-sized avatar

Kevin Lyda lyda

View GitHub Profile
@lyda
lyda / jwt-example.go
Created December 29, 2017 15:31
JsonWebTokens Example with generated key.
/* rewritten example of JsonWebToken example
* from https://gist.github.com/thealexcons/4ecc09d50e6b9b3ff4e2408e910beb22
* Keys are generated and packed to PEM-format at server start
* Plus some fixes and refactors
*
* My respect to thealexcons
*/
package main
import (
@lyda
lyda / latency.txt
Created January 31, 2017 15:22 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@lyda
lyda / www
Last active January 23, 2016 09:13 — forked from dg01d/www
#Server declaration for non-encrypted port 80
server {
listen 80;
server_name mysite.com www.mysite.com;
location /.well-known/acme-challenge/ {
root /var/www/challenges/;
try_files $uri =404;
}
@lyda
lyda / s3.sh
Last active August 29, 2015 14:20 — forked from chrismdp/s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1