Skip to content

Instantly share code, notes, and snippets.

View roadkell's full-sized avatar
🏳️‍⚧️

Kelly Roadkill roadkell

🏳️‍⚧️
View GitHub Profile
@jboner
jboner / latency.txt
Last active July 28, 2024 12: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
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
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

@bendmorris
bendmorris / potrace
Last active January 6, 2023 06:48
Potrace script designed for making FontForge pixel fonts
#!/bin/bash
# To use, move the potrace binary to potrace-bin, then place this script
# somewhere on the path so that it'll be found by fontforge.
# After autotracing, you'll need to apply the following transformation:
# scale uniform 10%, using glyph origin as the origin
# get the last parameter passed by fontforge - the name of the temp img file
for last; do true; done
# get all of the other parameters
length=$(($#-1))
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@ax3l
ax3l / CUDA_Compilers.md
Last active July 25, 2024 12:35
CUDA Compilers
@Jellybit
Jellybit / CameraControl.cs
Last active September 4, 2023 04:23
Super Metroid style camera for Unity3D.
using UnityEngine;
using System.Collections;
// This is basically how the Super Metroid camera worked. Whichever direction you moved, the camera would
// move in the same direction a multiple of the player's speed. Once the center of the camera moved a
// certain distance from the player, the camera would lock on the player and move the same speed. Change
// movement direction, and the camera would once again move more quickly to catch up and place itself
// ahead of the player's movement.
// Super Metroid also had area limits and locked certain axes based on where you were. For instance, if
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active June 4, 2024 10:08
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@ctechols
ctechols / compinit.zsh
Last active July 12, 2024 18:35
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@ramiabraham
ramiabraham / rom_suffix_codes.md
Last active July 10, 2024 18:56
Video game rom suffix codes (decoded)

Video game rom codes

You wouldn't download a car...


Primary rom codes

Probably what you're looking for

  • [a] Alternate (alternate version of the game, usually trying a different output method)
  • [p] Pirate
@fardinshikhiyev
fardinshikhiyev / .zshenv
Created August 22, 2016 22:13
sample .zshenv file with speed-up modification
#
# Generic .zshenv file for zsh
#
# .zshenv is sourced on ALL invocations of the shell, unless the -f option is
# set. It should NOT normally contain commands to set the command search path,
# or other common environment variables unless you really know what you're
# doing. E.g. running "PATH=/custom/path gdb program" sources this file (when
# gdb runs the program via $SHELL), so you want to be sure not to override a
# custom environment in such cases. Note also that .zshenv should not contain
# commands that produce output or assume the shell is attached to a tty.