Skip to content

Instantly share code, notes, and snippets.

View marktani's full-sized avatar

Nilan Marktanner marktani

View GitHub Profile
@timsuchanek
timsuchanek / subscription.html
Created November 15, 2017 14:11
Minimal GraphQL Subscription working with subscriptions-transport-ws 0.9.1
<html>
<head>
<title>Websockets Test</title>
</head>
<body>
<script>
const socket = new WebSocket(
'wss://subscriptions.graph.cool/v1/cirs1ufsg02b101619ru0bx5r','graphql-ws'
)
socket.addEventListener('open', event => {
@imkevinxu
imkevinxu / .gitconfig
Created November 5, 2012 09:42
`git random` alias that will commit a random commit message from http://whatthecommit.com/
[alias]
random = !"git add -A; git commit -am \"$(echo $(curl -s http://whatthecommit.com/index.txt)\" (http://whatthecommit.com)\")\"; git pull --rebase; git push"
@jboner
jboner / latency.txt
Last active July 20, 2024 23:12
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