Skip to content

Instantly share code, notes, and snippets.

I used to think that

ssh -X me@some.box

"just bloody worked". However this might not work - ssh must play ball on both sides of the link. On the remote (ssh server, X client) sshd must sit behind some port, tell Xlib to send X11 requests to it and then forward them back to you the X server (where the ssh client is). If the remote box is locked down to prevent this, you will get:

X11 forwarding request failed on channel 0

as part of an otherwise working login.

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
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
package main
import (
"fmt"
"strings"
)
type foo int
const (
One foo = iota
package main
import "fmt"
type day int
const (
Sunday day = iota
Monday
Tuesday
Wednesday
<div id="page"></div>
@jackielii
jackielii / latency.txt
Created June 12, 2012 14:12 — 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
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@jackielii
jackielii / main.go
Created June 24, 2012 18:42
tcp chat
func main() {
listener, err := net.Listen("tcp", listenAddr)
if err != nil {
log.Fatal(err)
}
for {
conn, err := listener.Accept()
if err != nil {
log.Fatal(err)
}
@jackielii
jackielii / main.go
Created June 24, 2012 18:43
tcp chat
func main() {
listener, err := net.Listen("tcp", listenAddr)
if err != nil {
log.Fatal(err)
}
for {
conn, err := listener.Accept()
if err != nil {
log.Fatal(err)
}
@jackielii
jackielii / appbar-without-fixed-positioning.html
Created December 22, 2015 10:26
Appbar without fixed positioning
<!doctype html>
<html lang="en">
<head>
<style type="text/css">
.app {
display: flex;
flex-direction: column;
height: 100vh;
/* the height can be anything: e.g. 100% of parent */
@jackielii
jackielii / tmux-cheatsheet.markdown
Created May 23, 2016 12:18 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname