Skip to content

Instantly share code, notes, and snippets.

ZeroBrain /
Created Sep 25, 2015
Android Google Photos's Uri
public String getImagePath(Context context, Uri uri){
if ("content".equalsIgnoreCase(uri.getScheme())) {
if (isGoogleOldPhotosUri(uri)) {
// return http path, then download file.
return uri.getLastPathSegment();
} else if (isGoogleNewPhotosUri(uri)) {
// copy from uri. context.getContentResolver().openInputStream(uri);
return copyFile(context, uri);
} else if (isPicasaPhotoUri(uri)) {
View Auto Layout
ttsubono / gist:3081457
Created Jul 10, 2012
View gist:3081457
// override a setter
// NSStringはcopyするという記事もあるが、copyもretainも同じ。
// you do not need to make a copy when Foo is a NSString.
// "copy" and "retain" for NSString are internally the same action.
- (void)setFoo:(Foo *)aFoo {
if (aFoo != foo) {
[foo release];
foo = [aFoo retain];
mramsden / NSDictionary+QueryStringBuilder.h
Created May 14, 2011
Creating a query string from an NSDictionary.
View NSDictionary+QueryStringBuilder.h
#import <Foundation/Foundation.h>
@interface NSDictionary (QueryStringBuilder)
- (NSString *)queryString;
You can’t perform that action at this time.