Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active May 27, 2024 03:11
The introduction to Reactive Programming you've been missing
@mrryanjohnston
mrryanjohnston / Dockerfile
Created March 9, 2014 01:38
Golang development environment using Docker
FROM ubuntu:13.10
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install golang
RUN mkdir /go
RUN export GOPATH=/go
ENV GOPATH /go
RUN export PATH=$PATH:$GOPATH/bin
@swanson
swanson / gist:7dee3f3474e30fe8f15c
Last active January 11, 2024 16:42
Retrofit LocalJsonClient
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import retrofit.client.Client;
import retrofit.client.Header;
import retrofit.client.Request;
import retrofit.client.Response;
import retrofit.mime.TypedInput;

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns                     on recent CPU
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 µ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 4X memory

@jvns
jvns / interview-questions.md
Last active May 14, 2024 18:47
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@mreiferson
mreiferson / Dockerfile
Last active April 12, 2016 10:10
nsqd Dockerfile
FROM ubuntu
RUN apt-get -y install wget tar ca-certificates
RUN wget https://s3.amazonaws.com/bitly-downloads/nsq/nsq-0.2.23.linux-amd64.go1.1.2.tar.gz
RUN tar zxvf nsq-0.2.23.linux-amd64.go1.1.2.tar.gz
RUN mkdir -p /usr/local/bin
RUN cp /nsq-0.2.23.linux-amd64.go1.1.2/bin/nsqd /usr/local/bin
RUN mkdir -p /data
VOLUME ["/data"]
@hintjens
hintjens / Makefile
Created November 6, 2013 12:51
ZeroMQ TIPC load-balancing example
all: srv.c
g++ srv.c /home/eerihug/dev/BakkaLinux/root/usr/local/lib/libzmq.a -lpthread -lrt -o srv
g++ cli.c /home/eerihug/dev/BakkaLinux/root/usr/local/lib/libzmq.a -lpthread -lrt -o cli
clean:
rm cli
rm srv
@dmitshur
dmitshur / gist:6927554
Last active September 17, 2023 07:35
[Legacy GOPATH mode] How to `go get` private repos using SSH key auth instead of password auth.

WARNING: This gist was created in 2013 and targets the legacy GOPATH mode. If you're reading this in 2021 or later, you're likely better served by reading https://tip.golang.org/cmd/go/#hdr-Configuration_for_downloading_non_public_code and https://golang.org/ref/mod#private-modules.

$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@ptrv
ptrv / spatialite_example.go
Last active September 8, 2022 02:48
SpatiaLite example in Go
package main
import (
"database/sql"
"github.com/mattn/go-sqlite3"
"log"
"os"
)
func runQuery(db *sql.DB, query string) {
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.