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 / Karabiner elements, Derek's happy mini vim
Created August 10, 2017 20:04
Karabiner elements mini vim with d + , word left d + . word right
{
"title": "Vi Mode (rev 3) + Derek's mods",
"rules": [
{
"description": "Vi Mode #1 [S + H/J/K/L → Arrow Keys]",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "s",
@DerekSelander
DerekSelander / liblink
Created February 13, 2018 20:31
Look for executables/frameworks that link to that keyword... i.e. liblink . CoreData
@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 / 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 / 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 / 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 / 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 / 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 / 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