Skip to content

Instantly share code, notes, and snippets.

@gloffreda
gloffreda / PSPDFUIKitMainThreadGuard.m
Created November 6, 2015 20:04 — forked from steipete/PSPDFUIKitMainThreadGuard.m
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…
// 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.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.
@gloffreda
gloffreda / gist:8ee36a2ceca18476927e
Created October 21, 2015 15:37 — forked from jimhorng/gist:594401f68ce48282ced5
Script to test PyAPNS
'''
Created on Mar 10, 2014
@author: jimhorng
'''
from apns import APNs, Payload
import time
import logging
import sys