Skip to content

Instantly share code, notes, and snippets.

View ris58h's full-sized avatar

Ilya Rodionov ris58h

View GitHub Profile
@tranquan
tranquan / xcode-keybindings-as-vscode.md
Last active April 13, 2025 04:43
Xcode KeyBindings as VSCode
@kamui545
kamui545 / dock.sh
Created October 24, 2019 03:37
Customize macOS dock via command line
#!/usr/bin/env bash
source "./dock_functions.sh"
declare -a apps=(
'/System/Applications/Utilities/Terminal.app'
'/System/Applications/Music.app'
'/Applications/Google Chrome.app'
'/Applications/PhpStorm.app'
'/Applications/Visual Studio Code.app'
@andrewpetrochenkov
andrewpetrochenkov / mac-dock.sh
Last active January 11, 2025 13:42
macOS Dock scripts #mac
#!/usr/bin/env bash
# list apps
defaults read com.apple.dock persistent-apps | grep '"_CFURLString"' | awk -F'"' '{print $4}' | php -R 'echo urldecode($argn)."\n";' | sed -e 's/file:\/\///g' | sed -e 's/\/$//g'
# list folders
defaults read com.apple.dock persistent-apps | grep '"_CFURLString"' | awk -F'"' '{print $4}' | php -R 'echo urldecode($argn)."\n";' | sed -e 's/file:\/\///g' | sed -e 's/\/$//g'
# add app
path=/Applications/Automator.app
@rmhsilva
rmhsilva / MacOS trackpad.md
Last active March 29, 2025 04:49
Accessing raw multitouch trackpad data (MacOS)
@swillits
swillits / Keycodes.swift
Last active October 22, 2024 15:30
Swift Keyboard Keycodes
struct Keycode {
// Layout-independent Keys
// eg.These key codes are always the same key on all layouts.
static let returnKey : UInt16 = 0x24
static let enter : UInt16 = 0x4C
static let tab : UInt16 = 0x30
static let space : UInt16 = 0x31
static let delete : UInt16 = 0x33
static let escape : UInt16 = 0x35
@puffnfresh
puffnfresh / CGSSpaces.h
Last active February 20, 2023 17:57
Header for undocumented Spaces APIs
#include <Carbon/Carbon.h>
typedef void *CGSConnectionID;
extern CGSConnectionID _CGSDefaultConnection(void);
#define CGSDefaultConnection _CGSDefaultConnection()
typedef uint64_t CGSSpace;
typedef enum _CGSSpaceType {
kCGSSpaceUser,
kCGSSpaceFullscreen,
@jboner
jboner / latency.txt
Last active April 15, 2025 17:30
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