Skip to content

Instantly share code, notes, and snippets.

kaiinui kaiinui

Block or report user

Report or block kaiinui

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kaiinui
kaiinui / FLMHTTPStub.h
Last active Feb 10, 2016
ObjC便利HTTPスタブクラス
View FLMHTTPStub.h
#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 Feb 7, 2016
CIDCloudKeyManager
View CIDCloudKeyManager.h
#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 Jun 26, 2015
ローカル通知のしよう
View ローカル通知の仕様
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 Jun 24, 2015
Dropbox の「無料容量」まとめ
@kaiinui
kaiinui / build.gradle
Created Apr 30, 2015
Maven 対応プロジェクトにするためにとりあえず書いとくべき gradle
View build.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 Aug 29, 2015
KeyBaseCacheDatastoreCallbacks
View KeyBaseCacheDatastoreCallbacks.java
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();
View CachingInterfaceController.h
@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 Aug 29, 2015
Gmail In-Box Actions の調査
View Gmail In-Box Actions の調査.md
  • One-Click Action
  • Rsvp Action
  • Review Action
  • Go-To Action

の 4 つがある。

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

@kaiinui
kaiinui / HttpRequestAdapter.java
Created Apr 23, 2015
AppEngine+Retrofit+OAuth
View HttpRequestAdapter.java
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 Aug 29, 2015
おれおれ Slim3 BaseController
View BaseController.java
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
You can’t perform that action at this time.