- printer off
- hold tiny reset button on the back
- keep holding tiny reset button for around 20 seconds while powering on the printer
- printer on and booted
- hold tiny reset button for around 5 seconds
@implementation XCDUUID | |
+ (void) load | |
{ | |
// query runtime if NSUUID class already exists, if so => done | |
if (objc_getClass("NSUUID")) | |
{ | |
return; | |
} | |
typedef struct CAColorMatrix { | |
float m11, m12, m13, m14, m15; | |
float m21, m22, m23, m24, m25; | |
float m31, m32, m33, m34, m35; | |
float m41, m42, m43, m44, m45; | |
} CAColorMatrix; | |
@interface CAFilter : NSObject | |
@property(copy) NSString *name; |
import Alamofire | |
let configuration = URLSessionConfiguration.default | |
configuration.requestCachePolicy = URLRequest.CachePolicy.reloadIgnoringLocalCacheData | |
let proxyConfiguration: [AnyHashable : Any] = [ | |
kCFNetworkProxiesHTTPEnable as AnyHashable: true, | |
kCFNetworkProxiesHTTPProxy as AnyHashable: host, | |
kCFNetworkProxiesHTTPPort as AnyHashable: port, |
#import <mach/mach.h> | |
float cpu_usage() | |
{ | |
kern_return_t kr; | |
task_info_data_t tinfo; | |
mach_msg_type_number_t task_info_count; | |
task_info_count = TASK_INFO_MAX; | |
kr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)tinfo, &task_info_count); |
This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].
When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes
// The trick is to copy the DeviceSupport folder from the beta to the stable version. | |
cp -r /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5261u\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ | |
// Then restart Xcode. You might need to do that for every beta of iOS 10/Xcode 8. |
// Compile with clang -framework Foundation sethack.m | |
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
/* | |
CFHashBytes from http://www.opensource.apple.com/source/CF/CF-1153.18/CFUtilities.c | |
*/ | |
#define ELF_STEP(B) T1 = (H << 4) + B; T2 = T1 & 0xF0000000; if (T2) T1 ^= (T2 >> 24); T1 &= (~T2); H = T1; |
//Given this: | |
NSArray *objects = @[@1, @2, @3] | |
//These are equivalent in behavior | |
NSNumber *first = [objects objectAtIndex:0] | |
NSNumber *second = (NSNumber *)CFArrayGetValueAtIndex(0) | |
//But is the code that runs the same? Not so much… in the first one we do… | |
objc_msgSend(objects, <selector reference>, 0) | |
-> http://sealiesoftware.com/msg/x86-mavericks.html |
// Taken from http://PSPDFKit.com. This snippet is under public domain. | |
#define UIKitVersionNumber_iOS_7_0 0xB57 | |
BOOL PSPDFIsUIKitFlatMode(void) { | |
static BOOL isUIKitFlatMode = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7. | |
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) { | |
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0; | |
} |