Skip to content

Instantly share code, notes, and snippets.

@insidegui
insidegui / AppIconView.swift
Last active March 14, 2026 19:28
A SwiftUI view that renders a Mac app's icon in the current appearance, respecting Liquid Glass customizations
import SwiftUI
#if canImport(WidgetKit)
import WidgetKit
#endif
/// Displays the app's icon in the current appearance (light, dark, clear, etc).
///
/// - note: The appearance of the icon will only reflect what's currently selected in System Settings,
/// it will not update in SwiftUI previews or if the app is overriding its own appearance.
public struct AppIconView: View {
@stephancasas
stephancasas / NSAlert+NSTextField.swift
Last active March 3, 2026 10:25
An extension on `NSAlert` for `NSTextField` drawing/management
//
// NSAlert+NSTextField.swift
//
// Created by Stephan Casas for OpenAI on 2/26/26.
//
import Foundation
import AppKit
extension NSAlert {
@brentsimmons
brentsimmons / NSMenuItem+RSCore.swift
Created January 6, 2026 04:11
Disable all menu item images in a Mac app.
//
// NSMenuItem+RSCore.swift
// RSCore
//
// Created by Brent Simmons on 1/5/26.
//
#if os(macOS)
import AppKit
import ObjectiveC
@stephancasas
stephancasas / IntelligenceUIPlatterView.swift
Created February 14, 2025 23:49
A SwiftUI expression of Apple Intelligence' NSIntelligenceUIPlatterView — used to accent intelligence-enabled UI components.
//
// IntelligenceUIPlatterView.swift
//
// Created by Stephan Casas on 2/13/25.
//
import SwiftUI
import AppKit
import Combine
@DavidBuchanan314
DavidBuchanan314 / Makefile
Last active January 16, 2024 12:40
simdutf incremental utf8 validation (proof-of-concept, not rigorously tested, see https://github.com/simdutf/simdutf/issues/361 )
CFLAGS := -Wall -Wextra -Wpedantic -O3
CXXFLAGS := ${CFLAGS}
LDFLAGS := -lsimdutf
main: main.o utf8_incremental.o
@stephancasas
stephancasas / CGWindowDictionary.swift
Last active July 26, 2025 17:28
A convenience type for working with the CFDictionary values returned by CGWindowListCopyWindowInfo(_:, _:)
//
// CGWindowDictionary.swift
//
// Created by Stephan Casas on 11/2/23.
//
import Foundation
import CoreGraphics
import AppKit
@stephancasas
stephancasas / CGCoordinateSpaces.swift
Created November 8, 2023 05:40
Extensions and utilities for working with CGPoint and CGRect across AppKit and CoreGraphics coordinate spaces.
//
// CGCoordinateSpaces.swift
//
// Created by Stephan Casas on 11/7/23.
//
import Foundation;
// MARK: - CGPoint
@stefanstranger
stefanstranger / mitmproxycertinstall.md
Last active January 2, 2026 20:34
# How to install mitmproxy certificate as root CA steps:

How to install mitmproxy certificate as root CA steps:

  1. Create a Android Virtual Device (AVD) using a non Google image to enable root access

  2. Start mitmproxy

  3. Install DuckDuckGo browser via downloaded apk on AVD

    Download via: https://apkcombo.com/duckduckgo/com.duckduckgo.mobile.android/

  4. Start ADV emulator with mitmproxy configured:

@stephancasas
stephancasas / CGEventSupervisor.swift
Last active January 10, 2025 21:28
A service class for monitoring global keyboard events in macOS Swift applications.
//
// CGEventSupervisor.swift
// Mouseless Messenger Pro
//
// Created by Stephan Casas on 4/24/23.
//
import Cocoa;
class CGEventSupervisor {
@xdavidhu
xdavidhu / wokplace-ssl-pinning-bypass.md
Last active March 12, 2026 12:36
Bypassing SSL Pinning in Facebook/Meta Workplace (Android)

Tested on Workplace for Android version 362.0.0.29.109. This approach might work in other Facebook/Meta applications. Thank you Imre Rad for helping me analyze the binary.

How does it work?

The Workplace Android app uses the Fizz open source TLS-1.3 library to communicate with the backend APIs. This library is written in C++, and is compiled to native code. It is running as a native library attached to the Android app.

The certificate verification is implemented in fizz/client/ClientProtocol.cpp, on line 1944. The easiest way to bypass this check is to patch the if (state.verifier()) { check on line 1942.