Skip to content

Instantly share code, notes, and snippets.

@jpsim
jpsim / logs.txt
Created July 11, 2014 18:16
SourceKit Logs in Xcode6-Beta3
sourcekit: [2:sourcekitd_initialize:1299: 0.0003] initializing
2014-07-11 11:12:15.618 Xcode[2028:36673] Failed to connect (abPeoplePickerTemplate) outlet from (IBCocoaStoryboardObjectLibraryAssetProvider) to (IBObjectLibraryAsset): missing setter or instance variable
2014-07-11 11:12:15.627 Xcode[2028:36673] Failed to connect (ikCameraDeviceViewTemplate) outlet from (IBCocoaStoryboardObjectLibraryAssetProvider) to (IBObjectLibraryAsset): missing setter or instance variable
2014-07-11 11:12:15.627 Xcode[2028:36673] Failed to connect (ikDeviceBrowserViewTemplate) outlet from (IBCocoaStoryboardObjectLibraryAssetProvider) to (IBObjectLibraryAsset): missing setter or instance variable
2014-07-11 11:12:15.628 Xcode[2028:36673] Failed to connect (ikImageBrowserViewTemplate) outlet from (IBCocoaStoryboardObjectLibraryAssetProvider) to (IBObjectLibraryAsset): missing setter or instance variable
2014-07-11 11:12:15.628 Xcode[2028:36673] Failed to connect (ikImageViewTemplate) outlet from (IBCocoaStoryboardObjectLibrar
@jpsim
jpsim / LevelDB.m
Last active August 29, 2015 14:04
RealmStringsBenchmarks
#import <Objective-LevelDB/LevelDB.h>
#include <mach/mach_time.h>
#include <stdint.h>
NSString *randomString(NSUInteger length) {
NSMutableString *string = [NSMutableString stringWithCapacity:length];
for (int i = 0; i < length; i++) {
[string appendFormat:@"%C", (unichar)('a' + arc4random_uniform(25))];
}
return string;
@jpsim
jpsim / testStackOverflow_sahara108.m
Created August 22, 2014 17:14
testStackOverflow_sahara108
- (void)testStackOverflow_sahara108
{
[[RLMRealm defaultRealm] transactionWithBlock:^{
[StringObject createInDefaultRealmWithObject:@[@"a"]];
}];
Class cl = [StringObject class];
NSString *key = @"stringCol";
NSString *value = @"a";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"%K = %@", key, value];
RLMArray *list = [cl objectsWithPredicate:pred];
@jpsim
jpsim / Alamofire.xml
Created October 14, 2014 21:06
SourceKitten Output
<jazzy>
<Other column="12" file="/Users/jp/Projects/Alamofire/Source/Alamofire.swift" line="26">
<Name>AlamofireErrorDomain</Name>
<USR>s:v9Alamofire20AlamofireErrorDomainSS</USR>
<Declaration>public let AlamofireErrorDomain: String</Declaration>
<Abstract>
<Para>Alamofire errors</Para>
</Abstract>
</Other>
<Other column="13" file="/Users/jp/Projects/Alamofire/Source/Alamofire.swift" line="33">
@jpsim
jpsim / Realm-ObjC.xml
Created January 13, 2015 07:27
SourceKitten 0.3.0 Realm Objective-C Docs
This file has been truncated, but you can view the full file.
<?xml version="1.0"?>
<sourcekitten>
<Other column="12" file="/Users/jp/realm/code/realm-cocoa/Realm/RLMArray.h" line="37">
<Name>RLMArray</Name>
<USR>c:objc(cs)RLMArray</USR>
<Declaration>@interface RLMArray : NSObject &lt;RLMCollection, NSFastEnumeration&gt;
@end</Declaration>
<Abstract>
<Para>RLMArray is the container type in Realm used to define to-many relationships.</Para>
[
{
"key.substructure" : [
{
"key.namelength" : 7,
"key.runtime_name" : "_TtC8__main__7Ellipse",
"key.name" : "Ellipse",
"key.filepath" : "\/Users\/jp\/Projects\/SwiftGraphics\/SwiftGraphics\/Ellipse.swift",
"key.bodylength" : 907,
"key.nameoffset" : 165,
@jpsim
jpsim / Export for iOS.jsx
Created August 19, 2012 22:16
ExtendScript iOS export
// This script makes a copy merged based on selection (or entire canvas),
// creates a new doc based on rounding the merged size to even dimensions,
// pastes it into a new doc, then exports it for both retina and non-retina iOS devices.
//
// Written on August 19, 2012 by JP Simard, Magnetic Bear Studios Inc.
exportForIOS();
function exportForIOS() {
// save document state
@jpsim
jpsim / Export for Android.jsx
Created September 7, 2012 15:23
ExtendScript for Android export
// This script makes a copy merged based on selection (or entire canvas),
// pastes it into a new doc, then exports it for Android in 320dpi, 240dpi, 160dpi, 120dpi
//
// Written by August 19, 2012 by JP Simard, Magnetic Bear Studios Inc.
exportForAndroid();
function exportForAndroid() {
// save document state
var initialState = activeDocument.activeHistoryState;
@jpsim
jpsim / stars_over_time.sql
Last active November 21, 2015 19:06
GitHub Archive Stars Over Time
select created_at
from [githubarchive:month.201401],
[githubarchive:month.201402],
[githubarchive:month.201403],
[githubarchive:month.201404],
[githubarchive:month.201405],
[githubarchive:month.201406],
[githubarchive:month.201407],
[githubarchive:month.201408],
[githubarchive:month.201409],
@jpsim
jpsim / iOS Development Resources.md
Last active December 12, 2015 06:19
List of useful resources for iOS devs

iOS Development Resources

Development

  • Cocoapods – Great dependency manager for iOS and Mac development
  • MagicalRecord – Super easy Core Data
  • AFNetworking – Best networking library for iOS out there
  • Cocoa Controls – Good site to find open source projects to help speed up your development

Debugging