Skip to content

Instantly share code, notes, and snippets.

View ninjinkun's full-sized avatar

Satoshi Asano ninjinkun

View GitHub Profile
@ninjinkun
ninjinkun / itc.pl
Created February 14, 2012 07:32
Itunes Connect Report Downloader
#!perl
use common::sense;
use HTTP::Request::Common;
use LWP::UserAgent;
use URI;
use Compress::Zlib;
use Perl6::Say;
my $uri = URI->new("https://reportingitc.apple.com/autoingestion.tft");
// NSString* url = [NSString stringWithFormat:@"http://api.twitter.com/1/users/profile_image?size=normal&screen_name=%@", [screenName gtm_stringByEscapingForURLArgument]];
NSString *url = [NSString stringWithFormat:@"http://n.hatena.ne.jp/%@/profile/image?type=face", screenName]; // はてなのURLに変更
@ninjinkun
ninjinkun / gist:5361327
Created April 11, 2013 07:04
ObjC ugomemo sample
#import <Foundation/Foundation.h>
id apiRequest(NSString *url)
{
NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
NSHTTPURLResponse *res;
NSError *error;
NSData *data = [NSURLConnection sendSynchronousRequest:req returningResponse:&res error:&error];
if (error) {
return nil;
@ninjinkun
ninjinkun / NSURLConnectionRetainTest.m
Last active December 16, 2015 19:49
does NSURLConnection block method has circular reference problem? Result is no.
#import <Foundation/Foundation.h>
@interface BlockTest : NSObject
-(void)request;
@end
@implementation BlockTest {
NSOperationQueue *_queue;
NSString *_str;
}
@ninjinkun
ninjinkun / gist:4e61c61cd9f5c90970a4
Created June 12, 2014 08:38
manage scrollsToTop
#import "ScrollsToTopManager.h"
@interface ScrollsToTopManager()
@property (nonatomic) NSHashTable *scrollViews;
@end
@implementation ScrollsToTopManager
+ (instancetype)sharedManager
{
1601265887