This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/* | |
This is part of the Reprise framework, not yet released publicly. | |
Copyright 2013 Marco Arment. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init]; | |
options.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat; | |
options.synchronous = NO; | |
options.networkAccessAllowed = YES; | |
options.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info) { | |
NSLog(@"%f", progress); //follow progress | |
}; | |
//This will work | |
[[PHImageManager defaultManager] requestImageForAsset:myPhAsset targetSize:self.view.frame.size contentMode:PHImageContentModeAspectFill options:options resultHandler: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generic select function | |
const $ = selector => […document.querySelectorAll(selector)]; | |
// usage | |
$(“div”).forEach(el => el.classList.add(“foo”)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NSString_stripHtml.h | |
// Copyright 2011 Leigh McCulloch. Released under the MIT license. | |
#import <Foundation/Foundation.h> | |
@interface NSString (stripHtml) | |
- (NSString*)stripHtml; | |
@end |
NewerOlder