I hereby claim:
- I am lukabernardi on github.
- I am lucabernardi (https://keybase.io/lucabernardi) on keybase.
- I have a public key ASC34kN73ZCTPYGD_tRxhBz2-D5qAdY8GCRKJcIqEULrpQo
To claim this, I am signing this object:
// | |
// AVAsset+VideoOrientation.h | |
// | |
// Created by Luca Bernardi on 19/09/12. | |
// Copyright (c) 2012 Luca Bernardi. All rights reserved. | |
// | |
#import <AVFoundation/AVFoundation.h> | |
typedef enum { | |
LBVideoOrientationUp, //Device starts recording in Portrait |
import lldb | |
import commands | |
import optparse | |
import shlex | |
def __lldb_init_module (debugger, dict): | |
debugger.HandleCommand('command script add -f windowDescription.window_description_command window_description') | |
print 'The "window_description" command has been installed' | |
import lldb | |
import commands | |
def __lldb_init_module (debugger, dict): | |
debugger.HandleCommand('command script add -f LBRShortcut.window_description_command window_description') | |
debugger.HandleCommand('command script add -f LBRShortcut.json_data_command json_data') | |
debugger.HandleCommand('command script add -f LBRShortcut.fire_fault_command fire_fault') | |
def window_description_command(debbuger, command, result, dict): |
import java.io.InputStream; | |
import java.lang.ref.WeakReference; | |
import java.net.URL; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.os.AsyncTask; | |
import android.util.Log; | |
import android.widget.ImageView; |
I hereby claim:
To claim this, I am signing this object:
UIImage *scaleAndRotateImage(UIImage *image) | |
{ | |
int kMaxResolution = 1920; | |
CGImageRef imgRef = image.CGImage; | |
CGFloat width = CGImageGetWidth(imgRef); | |
CGFloat height = CGImageGetHeight(imgRef); | |
protocol Reusable{ | |
static var reuseIdentifier: String { get } | |
} | |
extension Reusable { | |
static var reuseIdentifier: String { return String(Self.self) } | |
} | |
extension UICollectionViewCell : Reusable {} |
__weak typeof(self) weakSelf = self; | |
self.collectionView = (UICollectionView *)^{ | |
UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init]; | |
UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:weakSelf.view.bounds | |
collectionViewLayout:flowLayout]; | |
collectionView.delegate = weakSelf; | |
collectionView.dataSource = weakSelf; | |
return collectionView; |
/** | |
As Apple said [NSDateFormatter init] is very expensive (https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DataFormatting/Articles/dfDateFormatting10_4.html#//apple_ref/doc/uid/TP40002369-SW10) | |
In Apple's code is used a static const, but since NSDateFormatter | |
isn't thread safe a better approach is to use Thread local store (http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html#//apple_ref/doc/uid/10000057i-CH15-SW4) | |
to cache the NSDateFormatter instance | |
*/ | |
NSString * const kCachedDateFormatterKey = @"CachedDateFormatterKey"; | |
+ (NSDateFormatter *)dateFormatter |
I hereby claim:
To claim this, I am signing this object: