Skip to content

Instantly share code, notes, and snippets.

View stephancasas's full-sized avatar

Stephan Casas stephancasas

View GitHub Profile
@unnamedd
unnamedd / MacEditorTextView.swift
Last active March 19, 2026 16:18
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2025
* https://bsky.app/profile/tholanda.com
*
* (the twitter account is now deleted, please, do not try to reach me there)
* https://twitter.com/tholanda
*
* MIT license
@jaimeiniesta
jaimeiniesta / settings.jsonc
Created May 12, 2020 10:36 — forked from thbar/settings.jsonc
Current minimalistic VSCode setup (à la atom/textmate)
// My settings for VS Code - inspired by https://gist.github.com/thbar/cfeb158fb6fc52a0fed1df3c84048ffc
{
"window.zoomLevel": 2,
"editor.formatOnSave": true,
"editor.defaultFormatter": "JakeBecker.elixir-ls",
"terminal.integrated.shell.osx": "/bin/bash",
// path at top of editor is very noisy
"breadcrumbs.enabled": false,
@pjobson
pjobson / apple_install_dates.md
Last active July 18, 2026 17:55
OSX Install Dates

Various Versions of macOS/OSX will fail on install for various reasons. You can fix them by disconnecting from your wifi or network or resetting your NVRAM. Booting from your USB stick, opening terminal and doing: date ########## where the # nubers are below. Format is: MMDDhhmmYY

10.16 - 0.5 Leopard   - date 0101010121 <- Currently not needed
10.15 - Catalina      - date 0101010120 <- Currently not needed
10.14 - Mojave        - date 0101010119 <- Currently not needed
10.13 - High Sierra   - date 0101010118

10.12 - Sierra - date 0101010117

@plembo
plembo / upnper4dont.md
Last active April 22, 2026 22:03
UPnP with EdgeRouter: Don't do it! Ubiquiti. ER-4.

Want to configure UPnP on EdgeRouter-4?

Don't do it!

Introduction

As a former sysadmin that once helped ride herd over around 1,000 servers, of which around 10% were Internet-facing, I've never been a fan of autoconfiguation when it comes to punching holes through the firewall. I've seen the tripwire logs, and it's sobering.

The Problem

So enabling UPnP on my EdgeRouter-4 wasn't something I had on the roadmap, but when I ran into difficulty getting DLNA to work on the default VLAN, I thought it was worth looking into (never mind that, as I later learned, having UPnP turned on wasn't going make a bit of difference on my local network: another reason that mastering theory should always come before practice).

@zhuowei
zhuowei / reachable_services.txt
Created February 21, 2023 06:26
Reachable Mach services from the app sandbox on iOS 16.1
PurpleSystemAppPort
PurpleSystemEventPort
UIASTNotificationCenter
com.apple.ABDatabaseDoctor
com.apple.AppSSO.service-xpc
com.apple.AuthenticationServicesCore.AuthenticationServicesAgent
com.apple.CARenderServer
com.apple.ClipServices.clipserviced
com.apple.CoreAuthentication.daemon
com.apple.DeviceAccess.xpc
@stephancasas
stephancasas / EquatableProcess.swift
Created March 2, 2024 19:39
A type which records both the process identifier and the time at which the represented instance was dispatched.
//
// EquatableProcess.swift
//
// Created by Stephan Casas on 3/2/24.
//
/// A value type which records both the process identifier and the time at which the
/// represented instance was dispatched — providing a unique identity for a single
/// application instance.
struct EquatableProcess: Identifiable, Hashable {
@stephancasas
stephancasas / http-server.jxa.js
Created March 12, 2024 16:29
A basic HTTP server built in JXA for macOS
#!/usr/bin/env osascript -l JavaScript
ObjC.bindFunction('malloc', ['void*', ['int']]);
ObjC.bindFunction('memset', ['void*', ['void*', 'int', 'int']]);
ObjC.bindFunction('listen', ['int', ['int', 'int']]);
ObjC.bindFunction('socket', ['int', ['int', 'int', 'int']]);
ObjC.bindFunction('accept', ['int', ['int', 'void*', 'void*']]);
ObjC.bindFunction('bind', ['int', ['int', 'void*', 'int']]);
@stephancasas
stephancasas / NSViewReader.swift
Last active May 9, 2026 21:50
A SwiftUI view that can reliably access outer or inner instances of SwiftUI-managed NSView objects.
//
// NSViewReader.swift
//
// Created by Stephan Casas on 4/11/24.
//
import SwiftUI;
import AppKit;
import Combine;