Skip to content

Instantly share code, notes, and snippets.

View mcint's full-sized avatar

Loren McIntyre mcint

  • Berkeley/San Francisco, CA, USA
  • 10:34 (UTC -07:00)
View GitHub Profile
@tbutts
tbutts / tmux-migrate-options.py
Last active February 29, 2024 08:11
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
@gleicon
gleicon / list_objects_google_storage_boto3.py
Last active October 11, 2023 14:27
How to use boto3 with google cloud storage and python to emulate s3 access.
from boto3.session import Session
from botocore.client import Config
from botocore.handlers import set_list_objects_encoding_type_url
import boto3
ACCESS_KEY = "xx"
SECRET_KEY = "yy"
boto3.set_stream_logger('')
@quinnnorton
quinnnorton / Marriage.md
Last active September 15, 2020 04:29
Marriage

Marriage Agreement

English

In this marriage we seek to mingle the project of our lives.

Our relationship is one of companionship, shared resources, comfort, encouragement, and pleasure. We laugh with, and look after, each other. We share our courage, and our grief. We protect each other, but we push each other as well. We choose this because we believe we can go further together and grow more as humans than we can alone.

What keeps us together is language. We talk to each other, we never let stuff disappear, never sweep difficult topics under the carpet. Our commitment is to talk about the things we feel like we can't talk about, to push through fearful times and be present for one another. We will always still be getting to know each other, and sharing our respective evolving views of the world. We will seek to listen and learn from each other.

use warnings;
use Getopt::Std;
getopt('xytGgwsf',\%opts);
# pcm file = $opts{f}
# samples per pixel x
$xscale = $opts{x} // 1200;
@jboner
jboner / latency.txt
Last active May 3, 2024 15:17
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