Skip to content

Instantly share code, notes, and snippets.

View brendanzab's full-sized avatar
😵‍💫
writing elaborators

Brendan Zabarauskas brendanzab

😵‍💫
writing elaborators
View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active April 30, 2024 12:48
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶

fml

The function manipulation language

"I just implemented Conway's Game of Life in two lines of code. #fml"

pad = x flip[stitch] 0, stitch 0, flip[cat] 0, cat 0
life = pad, neighborhoods[3 3], [ravel, [sum in?: [x @ 4, + 3; 3]]]/2
@jboner
jboner / latency.txt
Last active May 6, 2024 07:06
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
@kelsey-sorrels
kelsey-sorrels / gist:3939096
Created October 23, 2012 14:34
rSimulate GeoJSON Draft

Purpose

To define a common data language for applications that simulate entire worlds. When many applications speak the same language, an ecosystem develops that is often more than the sum of its parts.

General

  • All data is UTF-8 encoded.
  • MIME type is application/json
// Original version: http://play.golang.org/p/ebO20f-eax
// Requires Rust 0.5.
extern mod std;
use io::WriterUtil;
const WIDTH: uint = 76;
const HEIGHT: uint = 10;
const NUM_BALLS: uint = 10;
@carlh
carlh / Default.sublime-commands
Created January 11, 2013 02:35
SublimeREPL config files for SML. Allows you to launch a functional REPL for SML that runs inside SublimeREPL. This assumes that you've installed SML at the default location. Dependencies: - SML (http://www.smlnj.org/) - SublimeREPL (https://github.com/wuub/SublimeREPL) - Language Definition (https://github.com/seanjames777/SML-Language-Definition
[
{
"caption": "SublimeREPL: SML",
"command": "run_existing_window_command", "args":
{
"id": "repl_sml",
"file": "config/SML/Main.sublime-menu"
}
}
]
anonymous
anonymous / RustSyntaxProposal
Created March 18, 2013 16:33
Proposal for new syntax for type definition. Motivation: Rust tries to mix concepts from Functional languages with syntax from C/C++. structs (records) are equivalent to the C/C++ version. However enums in rust do not behave like enums from c: Enums in rust are used to define Algebraic Data Types (sum types) that act similar to 'tagged unions' i…
type Name = {
first: ~str,
last: ~str
}
type Shape = Circle(int) | Rect(int, int) // Variants with constructors
type Direction = North | South | East | West // without constructors