Skip to content

Instantly share code, notes, and snippets.

@ibmendoza
ibmendoza / base.html
Last active November 14, 2015 05:57 — forked from gplume/base.html
httprouter vs. Gin - hijacked connection
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Chat</title>
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
</head>
One Many
Synchronous T/Try[T] Iterable[T]
Asynchronous Future[T] Observable[T]

Via Erik Meijer (video) and slides

####Examples:

@ibmendoza
ibmendoza / gist:3ec443f314bd35147e47
Created January 25, 2016 02:07 — forked from alexedwards/gist:4d20c505f389597c3360
Illustration of using httprouter and stack
package main
import (
"fmt"
"github.com/alexedwards/stack"
"github.com/julienschmidt/httprouter"
"net/http"
)
func main() {
@ibmendoza
ibmendoza / docker-gnatsd-cluster.org
Created July 18, 2016 05:55 — forked from wallyqs/docker-gnatsd-cluster.org
Docker GNATSD Cluster example

Docker GNATSD Cluster example

Below is an example of how to setup gnatsd cluster using Docker.

I have put 3 different configurations (one per gnatsd server) under a folder named conf as follows:

tree conf
@ibmendoza
ibmendoza / latency.markdown
Created July 19, 2016 06:21 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@ibmendoza
ibmendoza / my_thoughts_on_msgpack.md
Created August 24, 2016 09:50 — forked from frsyuki/my_thoughts_on_msgpack.md
My thoughts on MessagePack

My thoughts on MessagePack

Hi. My name is Sadayuki "Sada" Furuhashi. I am the author of the MessagePack serialization format as well as its implementation in C/C++/Ruby.

Recently, MessagePack made it to the front page of Hacker News with this blog entry by Olaf, the creator of the Facebook game ZeroPilot. In the comment thread, there were several criticisms for the blog post as well as MessagePack itself, and I thought this was a good opportunity for me to address the questions and share my thoughts.

My high-level response to the comments

To the best of my understanding, roughly speaking, the criticisms fell into the following two categories.

@ibmendoza
ibmendoza / ajax_typeahead.js
Created November 3, 2016 03:47
AJAX call with Bootstrap Typeahead
$('#edtProduct').typeahead({
//http://tatiyants.com/how-to-use-json-objects-with-twitter-bootstrap-typeahead/
source: function (query, process) {
items = []
map = {}
//TODO: get data from server

The Story of NPM and Yarn

In the beginning there was NPM, and for a time it was good. Packages went forth and multiplied. The New Gods proclaimed the great demon Dependency Management had been slain. But The Old Gods knew better, for they had seen much and knew that the demon can never be killed, only held at bay.

The Old Gods were ignored. In the folly of a young age grew an abundance of packages and with them grew the scourge of dependency. In the depths beneath the earth, in a place beyond memory, the great demon stirred.

The first sign something was wrong was non-deterministic package version mismatches. “This is fine!” The New Gods declared. “A temporary setback, nothing more! We can fix it.” And so they introduced shrinkwrap, a lamp to combat the growing darkness.

But it proved to be too little, too late, and dusk continued to fall. The New Gods suffered their first major defeat at the [Battle of Left-pad](https://www.theregister.co.uk/2016/03/23/npm_left_

@ibmendoza
ibmendoza / golang_job_queue.md
Created July 12, 2020 18:25 — forked from harlow/golang_job_queue.md
Job queues in Golang