Skip to content

Instantly share code, notes, and snippets.

View alok87's full-sized avatar
🎧
Working from home

Alok Kumar Singh alok87

🎧
Working from home
View GitHub Profile
@posener
posener / go-table-driven-tests-parallel.md
Last active April 4, 2024 19:45
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@bobrik
bobrik / README.md
Last active January 19, 2024 08:45
CFS hiccups
@siddharthkp
siddharthkp / reactivconf-2017-proposal.md
Last active February 25, 2024 10:06
Building applications for the next billion users
@kamilhristov
kamilhristov / kube.yaml
Created January 29, 2017 01:40
Example kops manifest
apiVersion: kops/v1alpha2
kind: Cluster
metadata:
name: kube.kamilhristov.com
spec:
cloudProvider: aws
etcdClusters:
- etcdMembers:
- instanceGroup: master-1
name: master-1
@kizbitz
kizbitz / dockerhub-v2-api-organization.sh
Last active April 3, 2024 08:47
Get the list of images and tags for a Docker Hub organization account
#!/bin/bash
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username, password, and organization
UNAME=""
UPASS=""
ORG=""
@jboner
jboner / latency.txt
Last active April 18, 2024 17:18
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
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