Skip to content

Instantly share code, notes, and snippets.

View renodesper's full-sized avatar
🍺
A heavy drinker of Aqua

Boy Sandy Gladies Arriezona renodesper

🍺
A heavy drinker of Aqua
View GitHub Profile
@renodesper
renodesper / local-storage-size.js
Last active December 9, 2021 07:28 — forked from cdmckay/local-storage-size.js
Detects the size of the browser's localStorage
if (localStorage && !localStorage.getItem('size')) {
var i = 0;
try {
// Test up to 10 MB
for (i = 100; i <= 10000; i += 100) {
localStorage.setItem('test', new Array((i * 1024) + 1).join('a'));
}
} catch (e) {
localStorage.removeItem('test');
localStorage.setItem('size', i - 100);
@renodesper
renodesper / latency.markdown
Created December 9, 2021 04:02 — forked from hellerbarde/latency.markdown
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

@renodesper
renodesper / .gitconfig
Created August 8, 2020 15:16
Git Alias
[alias]
a = add
ai = add --interactive
b = branch
bs = bisect
c = commit
ca = commit --amend
cam = commit --amend -m
cm = commit -m
co = checkout
#%PAM-1.0
auth sufficient pam_unix.so try_first_pass likeauth nullok
auth sufficient pam_fprintd.so
auth include system-login
account include system-login
password include system-login
@renodesper
renodesper / web-servers.md
Created August 9, 2018 08:01 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@renodesper
renodesper / keybase.md
Last active June 18, 2019 13:57
keybase.md

Keybase proof

I hereby claim:

  • I am renodesper on github.
  • I am renodesper (https://keybase.io/renodesper) on keybase.
  • I have a public key ASDjuNmtXQh3L_ZADqbfbFSIQsO2_AaPKwq_sxCIjPfLVgo

To claim this, I am signing this object: