Skip to content

Instantly share code, notes, and snippets.

View DerekSelander's full-sized avatar
👠
Set your status

Derek DerekSelander

👠
Set your status
View GitHub Profile
@DerekSelander
DerekSelander / gist:299f2c3b0443ee785d1508a3220f2aa9
Created September 20, 2020 04:47
Useful Commands to Speed up Global Warming
# Get llvm/clang/lldb shit to build in Xcode and not Ninja or VS Code
cmake -DLLVM_ENABLE_PROJECTS=clang ../llvm -G Xcode -DLLVM_INCLUDE_TESTS=FALSE -DLLVM_TARGETS_TO_BUILD="AArch64;X86" -DLLVM_ENABLE_IDE=TRUE
@DerekSelander
DerekSelander / compile swift for iOS
Created June 24, 2019 19:02
Always forget this and have a hard time googling... compile Swift for a certain arch
swiftc yo.swift -sdk `xcrun --show-sdk-path -sdk iphoneos` -target arm64e-apple-ios99.99.99.99
@DerekSelander
DerekSelander / omg.c
Last active September 27, 2019 15:59
Fixing Scansnap's code
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <assert.h>
#include <unistd.h>
@DerekSelander
DerekSelander / Going to hell for this
Created April 3, 2019 16:40
Launchd Daemon for displaying dancing Gandalf when user builds Xcode
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.selander.gandalf</string>
<key>Program</key>
<string>/usr/bin/open</string>
<key>ProgramArguments</key>
<array>
@DerekSelander
DerekSelander / dancing Gandlaf
Created March 5, 2019 02:03
Ohhhh I am a horrible person, launchctl load -w com.selander.boom.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.touchsomefile</string>
<key>ProgramArguments</key>
<array>
<string>open</string>
<string>https://www.youtube.com/watch?v=cMHcmReOg3c</string>
@DerekSelander
DerekSelander / BreakAfterRegex
Created January 10, 2019 19:11
Creates a regex breapoint which stops after the function execution
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import lldb
import optparse
import shlex
class BarOptions(object):
optdict = {}
@DerekSelander
DerekSelander / DerekDefault.idekeybindings
Last active December 11, 2018 16:57
Xcode key bindings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Menu Key Bindings</key>
<dict>
<key>Key Bindings</key>
<array>
<dict>
<key>Action</key>
@DerekSelander
DerekSelander / LLDB_command_search.mm
Created November 6, 2018 21:08
A cleaned up and commented file of the dynamically generated code from the LLDB search.py command
//
// LLDB_command_search.mm
// Code Challenge
//
// Created by Derek Selander on 11/6/18.
// Copyright © 2018 Selander. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
@DerekSelander
DerekSelander / overlaydbg
Created February 25, 2018 20:36
Display UIDebuggingInformationOverlay on iOS 11 without swizzling
+ (void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
int imageCount = _dyld_image_count();
const struct mach_header* UIKitHeader = nil;
for (int i = 0; i < imageCount; i++) {
if (strcmp(basename((char *)_dyld_get_image_name(i)), "UIKit") == 0) {
UIKitHeader = _dyld_get_image_header(i);
@DerekSelander
DerekSelander / dsresign
Last active April 16, 2023 02:26
Resign iOS .app directories, expects app dir, provisioning profile, [optional] new name for iOS app
#!/bin/bash
# MIT License
#
# Copyright (c) 2018 Derek Selander (@LOLgrep)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell