Skip to content

Instantly share code, notes, and snippets.

View kaiinui's full-sized avatar

kaiinui kaiinui

View GitHub Profile
@kaiinui
kaiinui / FLMHTTPStub.h
Last active February 10, 2016 03:07
ObjC便利HTTPスタブクラス
#import <Foundation/Foundation.h>
@interface FLMHTTPStub : NSObject
+ (void)stubURLContains:(nonnull NSString *)aStr withJSON:(nonnull NSDictionary *)json;
+ (void)stubURLContains:(nonnull NSString *)aStr withHttpStatusCode:(int)code withJSON:(nullable NSDictionary *)json;
@end
@kaiinui
kaiinui / CIDCloudKeyManager.h
Last active February 7, 2016 10:25
CIDCloudKeyManager
#import <Foundation/Foundation.h>
@interface CIDCloudKeyManager : NSObject
+ (instancetype)sharedManager;
- (void)startFetchingWithContainerIdentifier:(NSString *)identifier
storingCloudKeyBlock:(void(^)(NSString *cloudKeyID, NSString *cloudKeySecret))storingCloudKeyBlock
paringCloudKeyBlock:(void(^)(NSString *cloudKeyID, NSString *cloudKeySecret))paringCloudKeyBlock;
@end
@kaiinui
kaiinui / ローカル通知の仕様
Created June 26, 2015 09:10
ローカル通知のしよう
http://qiita.com/caesar_cat/items/08018ab22bea27b55443
https://developer.apple.com/library/ios/documentation/iPhone/Reference/UILocalNotification_Class/#//apple_ref/occ/instp/UILocalNotification/alertBody
http://ios-practice.readthedocs.org/en/latest/docs/notification/
iOS8 以上は、ローカル通知の設定にパーミッションが必要
「何分後に通知」ということができる
Background Fetch のハンドラーから呼べる
音がある通知と、音のない通知を選べる
タイトル、本文、アクション(スライドしてxxx)を設定できる
@kaiinui
kaiinui / まとめ.md
Created June 24, 2015 08:14
Dropbox の「無料容量」まとめ

@kaiinui
kaiinui / build.gradle
Created April 30, 2015 17:25
Maven 対応プロジェクトにするためにとりあえず書いとくべき gradle
apply plugin: 'maven'
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
@kaiinui
kaiinui / KeyBaseCacheDatastoreCallbacks.java
Last active August 29, 2015 14:20
KeyBaseCacheDatastoreCallbacks
public class KeyBaseCacheDatastoreCallbacks {
@PostPut
public void putToCacheAfterPut(PutContext putContext) {
final Entity entity = putContext.getCurrentElement();
MemcacheServiceFactory.getAsyncMemcacheService().put(entity.getKey(), entity);
}
@PreGet
public void getFromCacheIfHits(PreGetContext getContext) {
final Key key = getContext.getCurrentElement();
@import WatchKit;
@interface CachingInterfaceController : WKInterfaceController
- (void)updateLabel:(WKInterfaceLabel *)label withString:(NSString *)string;
- (void)updateLabel:(WKInterfaceLabel *)label asHidden:(BOOL)hidden;
- (void)updateImage:(WKInterfaceImage *)image withImageNamed:(NSString *)imageName;
- (void)updateImage:(WKInterfaceImage *)image withBaseNameForAnimation:(NSString *)baseName withRange:(NSRange)range duration:(NSTimeInterval)duration repeatCount:(NSInteger)repeatCount;
- (NSString *)currentImageNameForImage:(WKInterfaceImage *)image;
@kaiinui
kaiinui / Gmail In-Box Actions の調査.md
Last active August 29, 2015 14:19
Gmail In-Box Actions の調査
  • One-Click Action
  • Rsvp Action
  • Review Action
  • Go-To Action

の 4 つがある。

それぞれ受信メール一覧画面にて、当該メールの右のほうに表示される。

@kaiinui
kaiinui / HttpRequestAdapter.java
Created April 23, 2015 07:52
AppEngine+Retrofit+OAuth
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import oauth.signpost.http.HttpRequest;
@kaiinui
kaiinui / BaseController.java
Last active August 29, 2015 14:19
おれおれ Slim3 BaseController
import com.google.appengine.repackaged.org.apache.commons.codec.binary.Base64;
import com.google.appengine.repackaged.org.apache.commons.codec.binary.StringUtils;
import com.google.gson.Gson;
import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import java.io.IOException;
abstract public class BaseController extends Controller {
// Working with JSON