Skip to content

Instantly share code, notes, and snippets.

@0xack13
0xack13 / Combine+Pairwise.swift
Created August 2, 2025 21:58 — forked from fxm90/Combine+Pairwise.swift
Extension for a Combine-Publisher that returns the current and previous value.
//
// Combine+Pairwise.swift
//
// Created by Felix Mau on 17.05.21.
// Copyright © 2021 Felix Mau. All rights reserved.
//
import Combine
extension Publisher {
@0xack13
0xack13 / UserDefault.swift
Created August 2, 2025 16:09 — forked from simonbs/UserDefault.swift
Property wrapper that stores values in UserDefaults and works with SwiftUI and Combine.
/**
* I needed a property wrapper that fulfilled the following four requirements:
*
* 1. Values are stored in UserDefaults.
* 2. Properties using the property wrapper can be used with SwiftUI.
* 3. The property wrapper exposes a Publisher to be used with Combine.
* 4. The publisher is only called when the value is updated and not
* when_any_ value stored in UserDefaults is updated.
*
* First I tried using SwiftUI's builtin @AppStorage property wrapper
@0xack13
0xack13 / remove_sim_dups.py
Created May 25, 2025 21:39 — forked from buscarini/remove_sim_dups.py
Remove Xcode duplicated simulators
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from subprocess import Popen, PIPE
from subprocess import call
p = Popen(["xcrun","simctl","list","devices"], stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate(b"input data that is passed to subprocess' stdin")
@0xack13
0xack13 / main.js
Created May 7, 2025 21:50
FSM-escalation
const THRESHOLDS = {
ESCALATE_TO_BUG: 5,
ESCALATE_TO_P2: 10,
};
const PRIORITY = {
P1: 'P1',
P2: 'P2',
P3: 'P3',
};
@0xack13
0xack13 / Readme.txt
Created May 3, 2025 16:58 — forked from jcward/Readme.txt
Generating iOS P12 / certs without Mac OSX Keychain (on linux, windows, etc)
1) Generate a private key and certificate signing request:
openssl genrsa -out ios_distribution.key 2048
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/[email protected], CN=Example, C=US'
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create
- choose Production -> App Store and Ad Hoc
3) Download the resulting ios_distribution.cer, and convert it to .pem format:
@0xack13
0xack13 / Readme.txt
Created May 3, 2025 16:58 — forked from jcward/Readme.txt
Generating iOS P12 / certs without Mac OSX Keychain (on linux, windows, etc)
1) Generate a private key and certificate signing request:
openssl genrsa -out ios_distribution.key 2048
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/[email protected], CN=Example, C=US'
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create
- choose Production -> App Store and Ad Hoc
3) Download the resulting ios_distribution.cer, and convert it to .pem format:
@0xack13
0xack13 / extract_devices.rb
Last active April 30, 2025 13:54
extract_devices
require 'xcresult'
xcresult_path = 'path/to/your/Test.xcresult'
parser = XCResult::Parser.new(xcresult_path)
# This gives you the top-level parsed object
result = parser.parse
# You can now access test summaries in a nice structure
result.action_test_plan_run_summaries.each do |plan_summary|
@0xack13
0xack13 / wezterm.md
Last active March 31, 2025 15:32
wezterm
❯ cat ~/.wezterm.lua
-- Pull in the wezterm API
local wezterm = require("wezterm")

-- This will hold the configuration.
local config = wezterm.config_builder()

-- This is where you actually apply your config choices
@0xack13
0xack13 / og.md
Last active February 28, 2025 18:41
og

function og() { open $(git config --get remote.origin.url | sed 's/git@\(.*\):\(.*\)\.git/https:\/\/\1\/\2/g') }

#!/bin/bash

# Open the repo in the browser
function og() { 
  open "$(git config --get remote.origin.url | sed 's/git@\(.*\):\(.*\)\.git/https:\/\/\1\/\2/g')" 
}
@0xack13
0xack13 / gha_failure.sh
Last active March 4, 2025 18:48
gha_wfdiff.go
#!/bin/bash
# Disable pager
export GH_PAGER=cat
# Usage: ./failed_steps.sh <workflow_name_or_id> <repo_owner/repo_name>
WORKFLOW_NAME="$1"
REPO="$2"