Skip to content

Instantly share code, notes, and snippets.

View zchee's full-sized avatar
😩
want to Go knowledge...

Koichi Shiraishi zchee

😩
want to Go knowledge...
View GitHub Profile
@zhuowei
zhuowei / Ensemble.plist
Last active September 18, 2023 06:26
Put this file as /Library/Preferences/FeatureFlags/Domain/Ensemble.plist and reboot to (hopefully) turn on Universal Control on macOS 12
<?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>
<!-- not sure which one it is, so set both -->
<key>Ensemble</key>
<dict>
<key>Enabled</key>
<true/>
</dict>
@pervognsen
pervognsen / shift_dfa.md
Last active January 27, 2024 19:54
Shift-based DFAs

A traditional table-based DFA implementation looks like this:

uint8_t table[NUM_STATES][256]

uint8_t run(const uint8_t *start, const uint8_t *end, uint8_t state) {
    for (const uint8_t *s = start; s != end; s++)
        state = table[state][*s];
    return state;
}
@cormacrelf
cormacrelf / git index-exec.md
Last active November 10, 2022 18:30
A tool for operating on your git index, without stashing: git index-exec 'cargo fmt'

git-index-exec

A tool for operating on your git index, without stashing. It is common to want to commit only part of your working directory, but also be sure that each commit will compile if checked out, or has correctly formatted code. This tool checks out your current index to a temporary directory (stable for each unique git working dir PWD) and runs a shell snippet in it. It then takes any changes that command made, and applies them to the index.

*Hint: the 'index' is also known as the staging area. It's where the

@Siguza
Siguza / phoenix.c
Last active January 19, 2024 01:59
Phœnix exploit / iOS 9.3.5
// Bugs by NSO Group / Ian Beer.
// Exploit by Siguza & tihmstar.
// Thanks also to Max Bazaliy.
#include <stdint.h> // uint32_t, uint64_t
#include <stdio.h> // fprintf, stderr
#include <string.h> // memcpy, memset, strncmp
#include <unistd.h> // getpid
#include <mach/mach.h>
#include <stdlib.h>
@BuonOmo
BuonOmo / .gitconfig
Last active April 26, 2024 21:06
Git blame color scale from 20 month ago to now (https://stackoverflow.com/a/66250482/6320039)
[color "blame"]
highlightRecent = 234, 23 month ago, 235, 22 month ago, 236, 21 month ago, 237, 20 month ago, 238, 19 month ago, 239, 18 month ago, 240, 17 month ago, 241, 16 month ago, 242, 15 month ago, 243, 14 month ago, 244, 13 month ago, 245, 12 month ago, 246, 11 month ago, 247, 10 month ago, 248, 9 month ago, 249, 8 month ago, 250, 7 month ago, 251, 6 month ago, 252, 5 month ago, 253, 4 month ago, 254, 3 month ago, 231, 2 month ago, 230, 1 month ago, 229, 3 weeks ago, 228, 2 weeks ago, 227, 1 week ago, 226
[blame]
coloring = highlightRecent
date = human
ARCH ?= arm64
VERSION ?= 20.10
SPIN ?= live-server
vftool ?= ./vftool/build/vftool
DATA ?= ./data
ISO := ubuntu-$(VERSION)-$(SPIN)-$(ARCH).iso
MOUNTPOINT := /Volumes/Ubuntu
CD := $(DATA)/$(ISO)
@osy
osy / README.md
Last active August 9, 2023 12:58
UTM on Apple M1 Guides

Thanks to the work of @agraf, @KhaosT, @imbushuo, and others, we have Virtualization.framework working on M1 Macs. These [changes][1] have been merged with QEMU v5.2.0 RC3 (will rebase once the final release is out) and integrated with UTM, a brand new QEMU frontend designed in SwiftUI for iOS 14 and macOS 11.

Screenshot

Downloads

@djs55
djs55 / hyperkit-cpu.go
Created November 30, 2020 13:35
Measure hyperkit host CPU load
package main
import (
"fmt"
"os/exec"
"strconv"
"strings"
"time"
)
@tekknolagi
tekknolagi / Makefile
Last active March 13, 2024 22:46 — forked from pervognsen/asm_x64.c
x86-64 assembler in C
all:
gcc -Wall -Wextra -pedantic -g asm_x64.c -o asm_x64
@mattn
mattn / .tmux.conf
Last active October 17, 2023 03:52
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g mouse on
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
run -b '~/.tmux/plugins/tpm/tpm'
set -g @plugin 'odedlaz/tmux-onedark-theme'