This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alamofire.upload(.POST, | |
URLString: "https://api.golog13.com/v1/upload", | |
headers: nil, | |
multipartFormData: { multipartFormData in | |
// 文字列データはUTF8エンコードでNSData型に | |
multipartFormData.appendBodyPart(data: "image".dataUsingEncoding(NSUTF8StringEncoding)!, name: "type") | |
// バイナリデータ | |
// サーバによってはファイル名や適切なMIMEタイプを指定しないとちゃんと処理してくれないかも | |
multipartFormData.appendBodyPart(data: data, name: "data", fileName: "test.png", mimeType: "image/png") | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
UUID=$(ls -t1 ~/Library/Developer/CoreSimulator/Devices/ | head -1) | |
open $(find ~/Library/Developer/CoreSimulator/Devices/$UUID/data/Containers/Data/Application/ -name \*.realm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public protocol Mappable { | |
init?(_ map: Map) | |
mutating func mapping(map: Map) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef NS_ENUM (NSUInteger, kIconSize) { | |
kIconSizeSmall, | |
kIconSizeMedium, | |
kIconSizeLarge, | |
kIconSizeOriginal | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var B = require('./b'); | |
var A = module.exports = (function() { | |
var id, bInstance; | |
return { | |
init: function init(val) { | |
id = val; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var redis = require('redis'); | |
// constant | |
var CONST = { | |
type: { | |
JOIN: 0, | |
MESSAGE: 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# コンテナIDを調べる | |
$ sudo docker ps | |
$ sudo docker cp <コンテナID>:/etc/my.cnf my.cnf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DOCKER-VERSION 0.3.4 | |
FROM centos:6.4 | |
# ここは自由に変えてください | |
MAINTAINER Taro Tanaka | |
# パッケージインストール | |
RUN yum install -y mysql mysql-server | |
# mysqlサーバのセットアップ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## vim | |
brew install vim | |
## zsh | |
brew install zsh | |
brew install zsh-completions | |
# zsh で dircolor を使っている場合必要 | |
brew install coreutils | |
## htop:メモリやプロセスの確認 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; | |
[manager GET:@"https://hogehoge.api.com/user" | |
parameters:@{ @"user_id":@"hoge" } | |
success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
NSLog(@"res:%@", responseObject); | |
} | |
failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
NSLog(@"error:%@", error); | |
}]; |
NewerOlder