Skip to content

Instantly share code, notes, and snippets.

View Superbil's full-sized avatar
:shipit:
Working in Cloud

Superbil Superbil

:shipit:
Working in Cloud
View GitHub Profile
@caasi
caasi / tmux.conf
Last active November 7, 2026 20:02
Copy from tmux copy mode to the macOS clipboard over mosh.
# Copy from tmux to the macOS clipboard over mosh (tmux 3.4 and later).
#
# OSC 52 is a terminal escape sequence that sets the clipboard. mosh 1.4.0
# accepts it only in the form "52;c;" (the selection must be "c"). tmux copy
# mode sends an empty selection, so its copy does not arrive. This override
# makes tmux always send "c".
#
# Keep %p1 in the string. tmux 3.4 expands Ms with two parameters, and
# ncurses refuses a string that uses only %p2 ("could not expand Ms" in the
# tmux log): then tmux sends no OSC 52 at all. %p1%.0s uses %p1 and prints
@thesamesam
thesamesam / xz-backdoor.md
Last active October 26, 2026 12:03
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

import XCTest
import struct Foundation.UUID
extension UUID {
internal init(_ uint8s: UInt8...) {
var list:[UInt8] = Array(repeating: 0, count: 16)
for (index, value) in uint8s.enumerated() where index < 16 {
list[15-index] = value
}
self.init(list: list)
}
@huytd
huytd / wordle.md
Last active March 26, 2026 21:25
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@pofat
pofat / DelegatePublisher.swift
Last active August 9, 2022 04:42
How to handle delegate in a reactive way? Turn a delegate into Publisher.
import Combine
import CombineExt // Check this implementation: https://github.com/CombineCommunity/CombineExt/blob/main/Sources/Operators/Create.swift
import CoreBluetooth
// Client to generate target delegate publisher
// Learned from https://github.com/pointfreeco/composable-core-location/blob/main/Sources/ComposableCoreLocation/Live.swift
struct PeripheralClient {
enum Action: Equatable {
case didUptateName
@pervognsen
pervognsen / shift_dfa.md
Last active May 9, 2026 11:46
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;
}
@doole
doole / wine32_macos.org
Last active December 29, 2025 18:37
Use win32 binaries on macOS 10.15/11.0

macOS wine 32/64-bit Setup

Run 32-bit apps on macOS Catalina (10.15) and Big Sur (11.0).

Installation

Dependencies

First install homebrew brew.sh

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@diyfr
diyfr / action.d_docker-action.conf
Last active May 29, 2024 07:18
Fail2ban && Traefik
[Definition]
actionstart = iptables -N f2b-traefik-auth
iptables -A f2b-traefik-auth -j RETURN
iptables -I FORWARD -p tcp -m multiport --dports 443 -j f2b-traefik-auth
@ethanhuang13
ethanhuang13 / FacebookAuth.swift
Last active October 3, 2024 12:26
FacebookAuth is for iOS app developers who need to support Facebook login but don't want to use the official SDK
//
// FacebookAuth.swift
// GitHub: ethanhuang13
// Twitter: @ethanhuang13
import AuthenticationServices
import SafariServices
/*
Updated:
@ksc91u
ksc91u / gpg.md
Created February 19, 2020 09:00
auto start gpg-agent, apply env with zsh

auto-start gpg-agent with zsh

  • .gnupg/gpg-agent.conf
default-cache-ttl 7200
max-cache-ttl 14400
default-cache-ttl-ssh 7200
max-cache-ttl-ssh 14400
enable-ssh-support