Skip to content

Instantly share code, notes, and snippets.

@davedelong
davedelong / marsedit.applescript
Last active June 28, 2019 01:19
Export a blog from MarsEdit
on pad(thisNumber)
set thisText to thisNumber as text
if length of thisText = 1 then
return "0" & thisText
else
return thisText
end if
end pad
@davedelong
davedelong / reenumerate.m
Last active August 5, 2019 21:38
Reenumerate attached devices
#import <Foundation/Foundation.h>
#import <IOKit/IOKitLib.h>
#import <IOKit/usb/IOUSBLib.h>
int main() {
NSMutableDictionary *match = (__bridge NSMutableDictionary *)IOServiceMatching("IOUSBDevice");
if (match == nil) { return -1; }
match[@"IOPropertyMatch"] = @{@"SupportsIPhoneOS": @YES};
io_iterator_t iterator = 0;
@davedelong
davedelong / NSLocale.m
Last active October 15, 2022 08:02
Locales
/*
======================================================
THIS CODE IS FOR EDUCATIONAL PURPOSES ONLY.
I'M NOT RESPONSIBLE IF YOU SHIP THIS AND IT BLOWS UP IN YOUR FACE.
IF IT DOES AND YOU COMPLAIN TO ME I WILL LAUGH AT YOU.