Skip to content

Instantly share code, notes, and snippets.

View atsushisakai-gh's full-sized avatar
🏠
Working from home

Atsushi Sakai atsushisakai-gh

🏠
Working from home
View GitHub Profile
@SeongUgJung
SeongUgJung / GoogleImageFilePath.java
Created September 25, 2015 07:29
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)) {
@shinyaohira
shinyaohira / Auto Layout Guide.md
Last active November 23, 2019 14:50
Auto Layout Guide
@ttsubono
ttsubono / gist:3081457
Created July 10, 2012 06:03
setterをoverrideするときの基本的な記述方法
//
// 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
mramsden / NSDictionary+QueryStringBuilder.h
Created May 14, 2011 15:38
Creating a query string from an NSDictionary.
#import <Foundation/Foundation.h>
@interface NSDictionary (QueryStringBuilder)
- (NSString *)queryString;
@end