Skip to content

Instantly share code, notes, and snippets.

View NSExceptional's full-sized avatar

Tanner Bennett NSExceptional

View GitHub Profile
@NSExceptional
NSExceptional / StudentLoanDefaultGuide.md
Created January 14, 2020 02:46
Student Loan Default: The Guide

The original guide that was recently deleted here: https://www.reddit.com/r/studentloandefaulters/comments/cg1fd7/student_loan_default_a_guide/

I take no credit for this post, just happened to have it saved in a document and thought I'd be doing an injustice by not sharing this information once I saw the original post was missing! All credit goes to the original author, and without further ado...

Student Loan Default: A Guide

I’ve been wanting to write this for a long time, and seeing that person be in $500,000 of debt and no one really helping him on r/studentloans, I felt it was time to summarize everything I’ve learned. While there is great information on this sub, it is not centralized. It requires some digging. I hope now to bring all of it to the surface.

@NSExceptional
NSExceptional / XcodeBuildSettingsReference.md
Last active October 27, 2025 17:47
The Xcode Build Settings Reference in a searchable document, as of Xcode 8.3.2

Build settings reference

Active Build Action (ACTION)

A string identifying the build system action being performed.

Additional SDKs (ADDITIONAL_SDKS)

The locations of any sparse SDKs that should be layered on top of the one specified by Base SDK (SDKROOT). If more than one SDK is listed, the first one has highest precedence. Every SDK specified in this setting should be a "sparse" SDK, for example, not an SDK for an entire macOS release.

Alternate Install Group (ALTERNATE_GROUP)

iOS Shared Cache Extraction

Having fallen off the iOS-exploration train due to completing my Masters and other commitments, I have finally climbed back aboard in pursuit of understanding the telephony stack.

Like most things in iOS that are used frequently, the vast majority of the frameworks and libraries used in the telephony stack reside in the DYLD shared cache located at /System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv7.

In this post I am going to explain how to go about extracting this cache file so that you can then work with each library individually.

Get The Cache

The first step in all of this is to copy the cache over to your local machine. I did this using a program called iExplorer, but you can just as easily do it over SSH. As a side note, you can connect to your iDevice using SSH over USB if you install a tool called iProxy.

@NSExceptional
NSExceptional / .macOS Tweaks.md
Last active May 18, 2025 01:56
Some macOS tweaks I wrote

macOS tweaks

  • Make toolbars in AppKit compact where possible
  • Hide useless menu bar items in Chrome
  • Minor fixes to FaceTime.app
@NSExceptional
NSExceptional / AutoLayout.md
Last active April 26, 2025 13:07
The best damn AutoLayout guide I've ever seen

Edit Feb 4 5:16 PM: Skip to the bottom if you just want the article

It has been brought to my attention that rehosting someone else's content without asking them — even if you link to the original content — is not exactly polite. I did not ask the author before I rehosted his article, and while I feel I should have known better than to that, it just didn't occurr to me. It's not exactly plagarism, but it's still wrong on some level. I have reached out to him now about hosting it here publically, and if he says it's alright, I'll put it back.

You can find the original article here, on his site, and on his Medium page.

@NSExceptional
NSExceptional / mp4.ts
Created April 21, 2025 21:37
A small class for parsing MP4 file headers, with the ability to check whether the given file has the hvc1 tag. All in-process.
/*
* mp4.ts
* media
*
* Created by Tanner Bennett on 2025-04-19
* Copyright © 2025 Tanner Bennett. All rights reserved.
*/
type Atom = {
size: number;

#Simple Theos Setup Instructions

Add the following to ~/.bash_profile (create the file if it does not exist by typing touch ~/.bash_profile into terminal. The touch command simply creates a file if it does not exist):

export THEOS=/opt/theos
export PATH=$THEOS/bin:$PATH
export THEOS_DEVICE_IP=your_idevice_ip THEOS_DEVICE_PORT=22
@NSExceptional
NSExceptional / Private class usage in Swift.md
Last active September 25, 2024 21:53
An example of how to use a private class from Swift. It's not pretty, but it isn't too bad.

Using private Objective-C classes from Swift

In Objective-C, if you want to make use of one of Apple's internal classes, all you have to do is declare the class's interface with the methods you want to use. From there you can create instances of the class by using the NSClassFromString function to obtain a reference to the class object, like so:

[[NSClassFromString(@"_NSSomeClass") alloc] initWithFoo:5]

In Swift, this is not so easy. Referencing the type of the "hollow" Objective-C class interface anywhere in Swift code makes the compiler query the class for type information that is not known at compile time. This presents a huge problem. You cannot dynamically initialize a type either. Though, it seems the following code used to work at one point:

@NSExceptional
NSExceptional / tampermonkey-gh-copy-branch-hook.js
Created April 9, 2024 20:24
A Tampermonkey script to change the behavior of the copy branch button on GitHub PRs to copy some markdown instead
(function() {
'use strict';
function copyMarkdown() {
...
navigator.clipboard.writeText(markdown);
}
function addEventsToCopyElements() {
// Get all elements with tag name clipboard-copy and class js-copy-branch
@NSExceptional
NSExceptional / cpp_lookup.mm
Created November 3, 2022 23:07
Lookup and invoke a CPP function at runtime
#import <Foundation/Foundation.h>
#include <string>
#include <dlfcn.h>
class Foo {
int bar = 0;
std::string toString();
};
std::string Foo::toString() {