Skip to content

Instantly share code, notes, and snippets.

View joshbuhler's full-sized avatar
🏔️
Stuff. And things.

Joshua Buhler joshbuhler

🏔️
Stuff. And things.
View GitHub Profile
@zoul
zoul / OSStatus.m
Created October 19, 2010 08:21
Decode OSStatus error codes into strings.
NSString *NSStringFromOSStatus(OSStatus errCode)
{
if (errCode == noErr)
return @"noErr";
char message[5] = {0};
*(UInt32*) message = CFSwapInt32HostToBig(errCode);
return [NSString stringWithCString:message encoding:NSASCIIStringEncoding];
}
@ibc
ibc / get-sip-identities.rb
Created December 1, 2011 09:26
Script to get SIP identities from a TLS certificate following RFC 5922 section 7.1
#!/usr/bin/ruby
# Runs as follows:
#
# ~$ ruby get-sip-identities.rb PEM_FILE
require "openssl"
@afrael
afrael / gist:2777859
Created May 23, 2012 21:13
Merging to WAV files in iOS
NSURL *originalFileName = [NSURL alloc];
NSURL *RecordingPath =[NSURL fileURLWithPath:[appDelegate.RecordingPath stringByAppendingPathComponent:
[NSString stringWithFormat:@"RecordingFile.wav"]]];
NSLog(@"LocalRecoding Path :%@",RecordingPath);
originalFileName=RecordingPath;
NSURL *temporaryFileName = [NSURL alloc];
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active June 28, 2024 08:58
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@mayoff
mayoff / UIBezierPath+forEachElement.h
Created December 2, 2012 06:51
dragging an object along a CGPath on iOS demo
#import <UIKit/UIKit.h>
@interface UIBezierPath (forEachElement)
- (void)forEachElement:(void (^)(CGPathElement const *element))block;
@end
@joshbuhler
joshbuhler / Build number auto-bump
Last active December 15, 2015 21:09
This will automatically bump the build number of your project's info.plist file when creating an archive for distribution of your app. To use, add this script as a "Run Script" phase to your Xcode build phases, *before* the "Copy Bundle Resources" phase. (It needs to be here so that the updated info.plist file will be copied into the new archive…
#!/bin/bash
##################################################
#
# BuildVersion incrementing script v1.0
#
##################################################
processedPlist="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
projectPlist="${INFOPLIST_FILE}"
@bflorian
bflorian / the-washer-has-stopped.groovy
Last active November 6, 2022 10:41
Turn on a switch when a washing machine has been stopped for a certain period of time.
/*
* Turn on a switch when a washing machine has been stopped for a certain period of time
*
* This app makes use of the runIn() method to turn on the switch the specified period of time
* after the vibration stops. If vibration starts again before the time elapses, then the scheduled
* turn-on event is canceled.
*
*/
preferences {
@landongn
landongn / gist:5801161
Created June 17, 2013 22:41
IOS7 built in fonts
Thonburi,
Academy Engraved LET,
Snell Roundhand,
Avenir,
Marker Felt,
Geeza Pro,
Arial Rounded MT Bold,
Trebuchet MS,
Arial,
Marion,
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR