Skip to content

Instantly share code, notes, and snippets.


Felipe Cypriano fcy

View GitHub Profile
mackuba /
Last active Dec 7, 2019
New stuff from WWDC 2016

Following the tradition from last year, here's my complete list of all interesting features and updates I could find in Apple's OSes, SDKs and developer tools that were announced at this year's WWDC. This is based on the keynotes, the "What's New In ..." presentations and some others, Apple's release notes, and blog posts and tweets that I came across in the last few weeks.

If for some reason you haven't watched the talks yet, I really recommend watching at least the "State of the Union" and the "What's New In" intros for the platforms you're interested in. The unofficial WWDC Mac app is great way to download the videos and keep track of what you've already watched.

If you're interested, here are my WWDC 2015 notes (might be useful if you're planning to drop support for iOS 8 now and start using some iOS 9 APIs).

OSX → macOS 10.12 Sierra

jspahrsummers / GHRunLoopWatchdog.h
Created Jan 28, 2015
A class for logging excessive blocking on the main thread
View GHRunLoopWatchdog.h
/// Observes a run loop to detect any stalling or blocking that occurs.
/// This class is thread-safe.
@interface GHRunLoopWatchdog : NSObject
/// Initializes the receiver to watch the specified run loop, using a default
/// stalling threshold.
- (id)initWithRunLoop:(CFRunLoopRef)runLoop;
/// Initializes the receiver to detect when the specified run loop blocks for
steipete / Macros.h
Last active Dec 12, 2020
Declare on your main init that all other init methods should call. It's a nice additional semantic warning. Works with Xcode 5.1 and above. Not tested with earlier variants, but should just be ignored. A reference to this macro shortly appeared in…
View Macros.h
#if __has_attribute(objc_designated_initializer)
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer))
gruber / Liberal Regex Pattern for Web URLs
Last active May 11, 2021
Liberal, Accurate Regex Pattern for Matching Web URLs
View Liberal Regex Pattern for Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "". For a pattern that attempts to
match all URLs, regardless of protocol, see:
# Single-line version:
View gist:8213806
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
floriankugler / gist:6870499
Last active Jan 27, 2020
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
View gist:6870499
NSURLConnection | NSURLSession
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| N
robmiller / .gitconfig
Created Jul 17, 2013
Some useful Git aliases that I use every day
View .gitconfig
# Working with branches
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
ashfurrow / gist:5976579
Last active Feb 29, 2020
Image Blurring – Accelerate vs. CoreImage
View gist:5976579

1.3MB png 640x1136

  • Accelerate 179ms every time
  • CoreImage 298ms first time 147ms subsequent times @1x scale
  • CoreImage 262ms first time 126ms subsequent times @0.5x scale
  • CoreImage 260ms first time 118ms subsequent times @0.25x scale

(Lower on 0.5x probably because of whole number for blur radius)

boredzo / wwdc2013index-redacted.txt
Last active Dec 18, 2015
Script to rename WWDC videos and slides PDFs to include the session title in the name. Also included: A list of the session numbers and (redacted where necessary) titles, in TSV format, for use with this script.
View wwdc2013index-redacted.txt
100 Keynote
101 Platforms State of the Union
102 Apple Design Awards
109 Painting the Future
200 Accessibility in OS X
201 Building User Interfaces for iOS 7
202 Accessibility in iOS
203 What’s New in Cocoa Touch
204 What’s New with Multitasking
205 What’s New in Cocoa
NicholasPeterson / gist:5122235
Last active Dec 14, 2015
Simple mask iteration. Does not care about subsets.
View gist:5122235
// Use NS_OPTIONS for some compiler sugar.
// Use a type that fits your struct but consider using
// types directly to avoid 32/64bit width inconsistencies.
typedef NS_OPTIONS(UInt16, MaskType) {
MaskTypeOptionNone = 0,
MaskTypeOptionOne = 1 << 0,
MaskTypeOptionTwo = 1 << 1,