These commands are good as of 2011-07-27.
App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.
| // AKServerTime | |
| // By Henrik Nyh <http://henrik.nyh.se> 2010-03-14 under the MIT license. | |
| // | |
| // Keeps track of the current server time, adjusting for differences in | |
| // time zone/time sync between client and server, and accounting for latency. | |
| // | |
| // The latency adjustment is pessimistic: if we get 12:00:25 back with a latency | |
| // of 5 seconds, we know the current server time is between 12:00:25 (5 sec req, | |
| // 0 sec res) and 12:00:30 (0 sec req, 5 sec res). We assume it is 12:00:30 so | |
| // that trusting the server time may make you early, but never late. |
| #!/bin/bash | |
| # https://gist.github.com/949831 | |
| # http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/ | |
| # command line OTA distribution references and examples | |
| # http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson | |
| # http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution | |
| # http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/ | |
| # http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html |
These commands are good as of 2011-07-27.
App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.
| NSString *safe = self.keys.url.port.stringValue; | |
| NSString *unsafe = @"url.port.stringValue"; | |
| assert([safe isEqualToString:unsafe]); |
| # dump | |
| pg_dump testdb | pv -c -s $(psql -tc "SELECT pg_database_size('testdb')") -N dump | gzip > testdb.sql.gz | |
| # restore | |
| pv testdb_20120501.sql.gz | zcat | psql testdb |
| // | |
| // Copyright (c) 2012-2015 Cédric Luthi / @0xced. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| #if TARGET_OS_SIMULATOR | |
| static const char *fakeCarrier; | |
| static const char *fakeTime; |
| nline void pspdf_dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_block_t block) { | |
| dispatch_get_current_queue() == queue ? block() : dispatch_sync(queue, block); | |
| } |
| // Smart little helper to find main thread hangs. Enable in appDidFinishLaunching. | |
| // Only available with source code in DEBUG mode. | |
| @interface PSPDFHangDetector : NSObject | |
| + (void)startHangDetector; | |
| @end | |
| @implementation PSPDFHangDetector | |
| + (void)startHangDetector { | |
| #ifdef DEBUG |
| // 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> |