Skip to content

Instantly share code, notes, and snippets.

Derek Mullins drkmullins

  • Columbus, OH
Block or report user

Report or block drkmullins

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
@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active Nov 10, 2019
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
View PSPDFUIKitMainThreadGuard.m
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
@jimweirich
jimweirich / pullrequest.rb
Created May 5, 2013
Script I use to pull in pull requests from GitHub
View pullrequest.rb
#!/usr/bin/ruby -wKU
if ARGV.empty?
puts "Usage: pullrequest user:branch"
exit 1
end
url = `git config --get remote.origin.url`
unless %r{([^/]+)\.git$} =~ url
puts "Unable to determine repo from url (#{url})"
@mattt
mattt / uiappearance-selector.md
Last active Nov 4, 2019
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3
View uiappearance-selector.md

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
  sed 's/UI_APPEARANCE_SELECTOR//g'   | \
@0xced
0xced / NSObject+Subclasses.h
Last active Sep 4, 2017
NSObject category to get subclasses
View NSObject+Subclasses.h
#import <Foundation/Foundation.h>
@interface NSObject (Subclasses)
+ (NSSet *) subclasses_xcd;
@end
@nicerobot
nicerobot / README.md
Last active Nov 6, 2019
Mac OS X uninstall script for packaged install of node.js from https://stackoverflow.com/a/9287292/23056
View README.md

To run this, you can try:

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
@danielphillips
danielphillips / UILabel+dynamicSizeMe.h
Created Jun 2, 2011
Adjust UILabel to change it's frame according to it's content
View UILabel+dynamicSizeMe.h
@interface UILabel (dynamicSizeMe)
-(float)resizeToFit;
-(float)expectedHeight;
@end
You can’t perform that action at this time.