Skip to content

Instantly share code, notes, and snippets.

View ahbou's full-sized avatar
shipping

Ahmed Bouchfaa ahbou

shipping
View GitHub Profile
<?
/*
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.
@ahbou
ahbou / PHImageManager_iCloud_Remote.m
Last active October 8, 2019 13:32
Retreive an image from iCoud using PHImageManager
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:
// generic select function
const $ = selector => […document.querySelectorAll(selector)];
// usage
$(“div”).forEach(el => el.classList.add(“foo”));
// 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';
// NSString_stripHtml.h
// Copyright 2011 Leigh McCulloch. Released under the MIT license.
#import <Foundation/Foundation.h>
@interface NSString (stripHtml)
- (NSString*)stripHtml;
@end