Skip to content

Instantly share code, notes, and snippets.

Peter Kamb pkamb

  • Seattle
Block or report user

Report or block pkamb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pkamb
pkamb / gist:e0b5bf90e45cad714588feaf14eba523
Created Oct 24, 2017
rdar://21376114 - Custom input method app is added to Keyboard Input selector hundreds of times.
View gist:e0b5bf90e45cad714588feaf14eba523
rdar://21376114
# Custom input method app is added to Keyboard Input selector hundreds of times. [`NumberInput` sample code]
Summary:
Custom input method app is added to Input selector hundreds of times.
<bug report here>
Apple Developer Relations
June 17 2015, 12:14 PM
@pkamb
pkamb / systemKeyboardLayout
Last active Dec 20, 2015
Get current Mac OS X keyboard layout.
View systemKeyboardLayout
#import <Carbon/Carbon.h>
//Example: "com.apple.keylayout.US" or "com.apple.keylayout.Dvorak"
+ (NSString *)systemKeyboardLayout
{
TISInputSourceRef source = TISCopyCurrentKeyboardInputSource();
CFStringRef layoutID = TISGetInputSourceProperty(source, kTISPropertyInputSourceID);
return (NSString *)layoutID;
}
@pkamb
pkamb / gist:6085113
Created Jul 26, 2013
XCode 5 titanium build errors
View gist:6085113
Build settings from command line:
SDKROOT = iphoneos7.0
=== BUILD NATIVE TARGET AppModule OF PROJECT AppModule WITH CONFIGURATION Release ===
Check dependencies
CompileC build/AppModule.build/Release-iphoneos/AppModule.build/Objects-normal/armv7/ComAppModuleModule.o Classes/ComAppModuleModule.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/pkamb/Desktop/Titanium/AppModule
setenv LANG en_US.US-ASCII
@pkamb
pkamb / gist:6083957
Created Jul 25, 2013
Titanium mobile module build failure
View gist:6083957
Build settings from command line:
SDKROOT = iphoneos6.1
=== BUILD NATIVE TARGET AppModule OF PROJECT AppModule WITH CONFIGURATION Release ===
Check dependencies
ProcessPCH /var/folders/6d/rpk_48kx16v2cxdk_035mdr40000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ComAppModule_Prefix-bulwrpvsbwcevgfrxnwfmyzhewuu/ComAppModule_Prefix.pch.pth ComAppModule_Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/pkamb/Desktop/Titanium/AppModule
setenv LANG en_US.US-ASCII
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin:/Users/pkamb/.rbenv/shims:/Users/pkamb/.rbenv/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/pkamb/.rvm/bin"
@pkamb
pkamb / gist:5585751
Created May 15, 2013
Mac App Store code signing for a nested executable, via Apple ticket
View gist:5585751
Hello Peter,
I'm responding to your question about App Sandbox.
I checked with Mac App Review. The issue is that your login helper /LOGIN/HELPER/APP/PATH is not sandboxed. In other words, it does not have the com.apple.security.app-sandbox entitlement.
All executables are required to be sandboxed, whether they are the main app or an embedded helper.
Since your app is built from more than one target, the main app and the helper app, here's how we recommend to build this kind of project. Set the Code Signing Identity build setting at the project level to your development code signing identity (starts with "Mac Developer:") and not your distribution signing identity (starts with "3rd Party Mac Developer Application:"). Then delete the Code Signing Identity build setting from all targets by selecting the build setting and pressing the delete key to return the setting to its default value.
@pkamb
pkamb / fizzBuzzObjectiveC
Last active Oct 9, 2015
fizzBuzz in Objective-C
View fizzBuzzObjectiveC
// FizzBuzz in Objective-C
// By Peter Kamb
// Seattle, WA
- (void)fizzBuzzObjectiveC {
for (int i = 1; i <= 100; i++) {
NSString *output = @"";
if (i % 3 == 0) {
output = [output stringByAppendingString:@"Fizz"];
You can’t perform that action at this time.