Skip to content

Instantly share code, notes, and snippets.

@wilg
wilg / parallel_map.swift
Last active August 16, 2024 04:06 — forked from DougGregor/parallel_map.swift
Swift async/await implementation of a parallel map
import Foundation
// https://gist.github.com/DougGregor/92a2e4f6e11f6d733fb5065e9d1c880f
extension Collection {
func parallelMap<T>(
parallelism requestedParallelism: Int? = nil,
_ transform: @escaping (Element) async throws -> T
) async rethrows -> [T] {
let defaultParallelism = 2
let parallelism = requestedParallelism ?? defaultParallelism
@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>
@cfsamson
cfsamson / fantoccini_downloader.rs
Last active February 21, 2023 23:48
Fantocini file downloader - when you can't manually issua a GET request
// Cargo.toml
//
// [dependencies]
// serde_json = "1.0.61"
// notify = "4.0.15"
// anyhow = "1.0.38"
// fantoccini = "0.17.1"
// tokio = {version="1.1.1", features= ["full"]}
// log = "0.4.14"
// env_logger = "0.8.2"
@thalamus
thalamus / ArchLinuxARM-M1
Last active July 22, 2025 02:58
How to boot Arch Linux ARM in QEMU (patched for M1)
/*
* This document is provided to the public domain under the
* terms of the Creative Commons CC0 public domain license
*/
How to boot Arch Linux ARM in QEMU (patched for M1)
Prerequisites:
QEMU - patched for M1 processors - patches: https://github.com/utmapp/qemu
@toonetown
toonetown / karabiner-elements-remote-desktop.json
Last active August 3, 2024 09:55
Karabiner Elements JSON configuration for Microsoft Remote Desktop
{
"title": "Microsoft Remote Desktop",
"rules": [
{
"description": "Windows Mappings",
"manipulators": [
{
"type": "basic",
"from": { "key_code": "x", "modifiers": { "mandatory": [ "command" ] } },
"to": [ { "key_code": "x", "modifiers": [ "left_control" ] } ],