Skip to content

Instantly share code, notes, and snippets.

View RPing's full-sized avatar
🎯
Focusing

Stephen Chen RPing

🎯
Focusing
View GitHub Profile
apiVersion: apps/v1
kind: Deployment
metadata:
name: ubuntu-deployment
labels:
app: ubuntu
spec:
replicas: 1
selector:
matchLabels:
@RPing
RPing / latency.txt
Created February 21, 2021 11:38 — forked from jboner/latency.txt
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
@RPing
RPing / binlog-rollback.pl
Created May 25, 2020 12:37 — forked from C0reFast/binlog-rollback.pl
binlog-rollback.pl
#!/usr/bin/perl -w
use strict;
use warnings;
use Class::Struct;
use Getopt::Long qw(:config no_ignore_case); # GetOption
# register handler system signals
use sigtrap 'handler', \&sig_int, 'normal-signals';
@RPing
RPing / Open iTerm2 in Finder folder
Last active December 10, 2016 06:44
Apple script to open an iterm2 window from right-clicking on a folder in Finder. To use:(1) Open Automator(2) Create a new service(3) Change "Service receives selected" drop downs to "Files or folders" in "Finder"(4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer: