Skip to content

Instantly share code, notes, and snippets.

View mcthomas's full-sized avatar

Matt Thomas mcthomas

View GitHub Profile
@ChristopherA
ChristopherA / macOS-Preferences-Defaults.sh
Last active October 8, 2024 04:12
macOS Preferences Defaults
#!/usr/bin/env zsh
#===========================================================================
# * INFO
#
# macOS Preferences Defaults
# By Christopher Allen @ChristopherA https://github.com/christophera/
# My most basic macOS preferences, in this gist to make it easy to load on
# multiple machines and VMs. Ideally runs on all macOS versions since Yosemite,
#!/bin/sh
# default commands for osx to make it nicer to work with
##########################
# General UI?UX settings #
##########################
# Set hostname (hex of MVB9APPS)
sudo scutil --set ComputerName "0x4d56423941505053"
sudo scutil --set HostName "0x4d56423941505053"
@miner
miner / gdiff
Last active October 26, 2022 18:29
using FileMerge as git difftool on Mac OS X
#!/bin/bash
# my git difftool, calls FileMerge with project as -merge target
# better than using opendiff
#
# cd to your project dir and and run difftool like this:
# git difftool -d -x gdiff
# find top level of git project
dir=$PWD
until [ -e "$dir/.git" ]; do
@jboner
jboner / latency.txt
Last active November 15, 2024 14:00
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