-
git stash
保存当前的工作进度。会分别对暂存区和工作区的状态进行保存
-
git stash save "message..."
这条命令实际上是第一条 git stash
命令的完整版
#!/bin/sh | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
# make sure the output directory exists | |
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
# Step 1. Build Device and Simulator versions | |
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | |
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build |
// | |
// ViewController.m | |
// AVPlayerCaching | |
// | |
// Created by Anurag Mishra on 5/19/14. | |
// Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer | |
// | |
#import "ViewController.h" | |
#import <AVFoundation/AVFoundation.h> |
#import <objc/message.h> | |
#define DECORATE printf("\n\n+*%%$%%*+-+*%%$%%*+-+*%%$-+*%%$%%*+-+*%%$%%*+-+*%%$-+*%%$%%*+-+*%%$%%*+-\n\n") | |
@implementation NSObject (logProperties) - (void) logProperties { DECORATE; @autoreleasepool { unsigned int propCt = 0; | |
const char * myName = [self.description substringWithRange: | |
(NSRange){1,[self.description rangeOfString:@":"].location-1}].UTF8String; | |
objc_property_t *pA = class_copyPropertyList(self.class, &propCt); | |
for (int i = 0; i < propCt; i++) { NSString *name; printf("%s [%s] = %s\n", myName, | |
(name = [NSString.alloc initWithUTF8String:property_getName(pA[i])]).UTF8String, | |
[objc_msgSend(self,NSSelectorFromString(name)) description].UTF8String); | |
} free(pA); } DECORATE; } |
- (UIImage *)rotateImage:(UIImage *)image ofAngle:(CGFloat)degrees { | |
CGImageRef imgRef = image.CGImage; | |
CGFloat angleInRadians = degrees * (M_PI / 180); | |
CGFloat width = CGImageGetWidth(imgRef); | |
CGFloat height = CGImageGetHeight(imgRef); | |
CGRect imgRect = CGRectMake(0, 0, width, height); | |
CGAffineTransform transform = CGAffineTransformMakeRotation(angleInRadians); | |
CGRect rotatedRect = CGRectApplyAffineTransform(imgRect, transform); | |
// 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> |
nline void pspdf_dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_block_t block) { | |
dispatch_get_current_queue() == queue ? block() : dispatch_sync(queue, block); | |
} |
// Declare enums like so: | |
#define IMAGE_STATUS(XX) \ | |
XX(kDOImageStatusOK, = 0) \ | |
XX(kDOImageStatusCached, )\ | |
XX(kDOImageStatusRetry, ) | |
DECLARE_ENUM(DOImageStatus, IMAGE_STATUS) |
i386 : iPhone Simulator | |
x86_64 : iPhone Simulator | |
arm64 : iPhone Simulator | |
iPhone1,1 : iPhone | |
iPhone1,2 : iPhone 3G | |
iPhone2,1 : iPhone 3GS | |
iPhone3,1 : iPhone 4 | |
iPhone3,2 : iPhone 4 GSM Rev A | |
iPhone3,3 : iPhone 4 CDMA | |
iPhone4,1 : iPhone 4S |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs