Skip to content

Instantly share code, notes, and snippets.

View redaready's full-sized avatar
😀

redaready redaready

😀
  • Aix en provence, France <-> Tokyo, Japan
View GitHub Profile
@jdp
jdp / refactor.py
Created December 7, 2010 04:59
A toy tail-recursive concatenative language implementation
#!/usr/bin/env python
import sys
import types
import operator
class Runtime:
def __init__(self, env={}, stack=[]):
self.env = {
# Primitive words, not an impressive base but it works
@mattpodwysocki
mattpodwysocki / nodeconf_2011.md
Created May 7, 2011 02:03 — forked from guybrush/nodeconf_2011.md
a list of slides from nodeconf 2011
@perses76
perses76 / redis_vs_sqlite.py
Created October 5, 2011 14:23
Redis vs SQLite
from datetime import datetime
import redis
import random
import sqlite3
BROKER_HOST = "localhost" # Maps to redis host.
REDIS_PASSWORD = None
KEY_PREFIX = "speed_"
ALPHABETE = "qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM"
SQLITE_DB = ":memory:"
@y10h
y10h / redis_vs_sqlite.py
Created November 7, 2011 10:04 — forked from perses76/redis_vs_sqlite.py
Redis vs SQLite
from datetime import datetime
import redis
import random
import sqlite3
BROKER_HOST = "localhost" # Maps to redis host.
REDIS_PASSWORD = None
KEY_PREFIX = "speed_"
ALPHABETE = "qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM"
SQLITE_DB = ":memory:"
@terrancesnyder
terrancesnyder / regex-japanese.txt
Created November 7, 2011 14:05
Regex for Japanese
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@j2labs
j2labs / gist:1763847
Created February 8, 2012 01:05
A fresh cerealization.
$ python ./cereal.py
Dumping:
json: 16.3266839981
simplejson: 21.8916499615
cjson: 5.22964906693
ujson: 2.02208805084
cPickle: 18.5925779343
tnetstrings: 60.592509985
tnetstring: 2.44516205788
msgpack: 21.7611129284
@jboner
jboner / latency.txt
Last active December 25, 2025 23:33
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
@zcdziura
zcdziura / Crypto Test
Last active July 13, 2023 05:08
Encryption using Elliptic Curves and Diffie-Hellman key exchanges
import java.io.UnsupportedEncodingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.PublicKey;
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active November 23, 2025 22:45 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@steven2358
steven2358 / ffmpeg.md
Last active December 25, 2025 16:52
FFmpeg cheat sheet