This file contains 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
# Run the following code on a folder that contains all your images | |
for f in *.png; do convert "$f" -background white -alpha remove -flatten -alpha off "$f"; done |
This file contains 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
#import "NSObject+PWObject.h" | |
@implementation NSObject (PWObject) | |
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay { | |
int64_t delta = (int64_t)(1.0e9 * delay); | |
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delta), dispatch_get_main_queue(), block); | |
} | |
@end |
This file contains 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
@implementation UIPopoverPresentationController (PSPDFAdditions) | |
+ (void)load { | |
PSPDFSwizzleMethodImplementation(self, @selector(containerViewWillLayoutSubviews), ^(UIPopoverPresentationController *_self) { | |
// Refresh bar button view internals | |
[_self pspdf_updateBarButtonView]; | |
((void( *)(id, SEL))objc_msgSend)(_self, PSPDFPrefixedSelector(containerViewWillLayoutSubviews)); | |
}); | |
} |
This file contains 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
// | |
// ViewController.m | |
// PopoverPresentationControllerExample | |
// | |
// Created by Bryan Irace on 8/8/14. | |
// Copyright (c) 2014 Bryan Irace. All rights reserved. | |
// | |
#import "CustomCompactPresentationController.h" | |
#import "ViewController.h" |
This file contains 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
static UIImage *imageWithSize(CGSize size) { | |
static CGFloat const kThickness = 20; | |
static CGFloat const kLineWidth = 1; | |
static CGFloat const kShadowWidth = 8; | |
UIGraphicsBeginImageContextWithOptions(size, NO, 0); { | |
CGContextRef gc = UIGraphicsGetCurrentContext(); | |
CGContextAddArc(gc, size.width / 2, size.height / 2, | |
(size.width - kThickness - kLineWidth) / 2, | |
-M_PI / 4, -3 * M_PI / 4, YES); |
This file contains 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
//////////////////////////////////////////////////////////////////////////// | |
// | |
// Copyright 2014 Realm Inc. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// |
This file contains 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
import UIKit | |
// Snapshot utilities | |
extension UIView { | |
func snapshotView(view: UIView, afterUpdates: Bool) -> UIView { | |
let snapshot = view.snapshotViewAfterScreenUpdates(afterUpdates) | |
self.addSubview(snapshot) | |
snapshot.frame = convertRect(view.bounds, fromView: view) | |
return snapshot |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<Bucket | |
type = "2" | |
version = "2.0"> | |
<Breakpoints> | |
<BreakpointProxy | |
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint"> | |
<BreakpointContent | |
shouldBeEnabled = "Yes" | |
ignoreCount = "0" |
This file contains 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
extension Dictionary { | |
public func map<T: Hashable, U>(@noescape transform: (Key, Value) -> (T, U)) -> [T: U] { | |
var result: [T: U] = [:] | |
for (key, value) in self { | |
let (transformedKey, transformedValue) = transform(key, value) | |
result[transformedKey] = transformedValue | |
} | |
return result | |
} | |
This file contains 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
curl -X POST \ | |
-H "X-Parse-Application-Id: LL9oIdzIkmwl5xyowQQu0fTmXyUWfet9RuAzwHfj" \ | |
-H "X-Parse-REST-API-Key: R3S8PYQKuzeV4c8MUeO5ved46C50MEp56boDHW1O" \ | |
-H "Content-Type: application/json" \ | |
-d @data.json \ | |
https://parseapi.back4app.com/functions/import |
OlderNewer