Skip to content

Instantly share code, notes, and snippets.

@merlinmann
merlinmann / sous-vide-tests.md
Last active March 17, 2023 06:16
sous vide cooking times

Sous Vide Cooking Times

Good? FOOD TIME TEMP COMMENT
CANON! pork chops, MED 1:30 143°
CANON! prime rib roast, MR 6:00 129.5 Works every time!
CANON! pork chops SUPER thick 1:45 142° solid MR+
YES ribeye, frozen, R 1:30 126° Awesome at low temp
YES thick pork chops, MR 1:30 142° SO good
XXX filet mignon, MR 1:30 130° XX
@jjb
jjb / file.md
Last active December 2, 2024 09:16
Using Jemalloc 5 with Ruby.md

For years, people have been using jemalloc with ruby. There were various benchmarks and discussions. Legend had it that Jemalloc 5 didn't work as well as Jemalloc 3.

Then, one day, hope appeared on the horizon. @wjordan offered a config for Jemalloc 5.

Ubuntu/Debian

FROM ruby:3.1.2-bullseye
RUN apt-get update ; \
@kddnewton
kddnewton / json.rb
Last active December 18, 2024 17:34
JSON parser with pattern matching
require "json"
struct = { "a" => 1, "b" => 2, "c" => [1, 2, 3], "d" => [{ "e" => 3 }, nil, false, true, [], {}] }
source = JSON.dump(struct)
tokens = []
index = 0
until source.empty?
tokens <<
@zhuowei
zhuowei / safariinject.m
Last active October 22, 2021 17:15
Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// clang -fmodules -shared -Wall -Os -o libsafariinject.dylib safariinject.m
//
// If SIP off:
// DYLD_INSERT_LIBRARIES=$PWD/libsafariinject.dylib /Applications/Safari.app/Contents/MacOS/Safari
//
// If SIP on, you can demo this by manually removing Safari's code signing signature, but many
// features (eg saved logins) won't be readable by the resigned app:
// cp -a /Applications/Safari.app ./
// codesign --remove Safari.app/Contents/MacOS/Safari
@CombinedEffort
CombinedEffort / readme.en.md
Last active November 25, 2024 20:04
How to run Windows 11 on ARM in QEMU 6.1 on Apple Silicon Mac

How to run Windows 11 on ARM in QEMU 6.1 on Apple Silicon Mac

  1. Follow the excellent gist here, up to and including step 7 : https://gist.github.com/niw/e4313b9c14e968764a52375da41b4278

  2. I converted my VHDX to qcow2 - I doubt if that's significant, but YMMV:

./qemu-img convert -p -O qcow2 ~/Windows11_InsiderPreview_Client_ARM64_en-us__22454-orig.VHDX Windows11.img
  1. Run qemu with a slightly modified command-line. It may not be the most efficient, but it worked for me:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UnifiedBar</key>
<dict>
<key>DisclosureRequired</key>
<string>ace440ac-b4f6-4b43-aade-02bba1589aef</string>
<key>Enabled</key>
<false/>
@nrjdalal
nrjdalal / QEMU-Silicon-Mac-Virtualization.md
Last active November 21, 2024 14:59
Create Virtual Machines using QEMU on Silicon based Apple Macs

Install QEMU on Silicon based Apple Macs (June 2021)

Option 1 - Automatically

zsh -c "$(curl -fsSL https://raw.githubusercontent.com/nrjdalal/silicon-virtualizer/master/install-qemu.sh)"

Option 2 - Manually

  • Install Xcode command line tools

xcode-select --install
@niw
niw / README.en.md
Last active December 1, 2024 17:09
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@foone
foone / get-local-key.sh
Created June 18, 2020 21:11
Get a key from a GPG keyserver and save it locally
mkdir temp-keyring
gpg --homedir temp-keyring --no-default-keyring --verbose --keyserver pool.sks-keyservers.net --output foobar.txt --recv-keys A278B781FE4B2BDA
gpg --homedir temp-keyring --output A278B781FE4B2BDA.gpg --armor --export
rm -rf temp-keyring/
@ayyybe
ayyybe / ccdl.command
Last active December 11, 2024 14:09
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear