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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
struct Environment { | |
let apiService: ServiceProtocol | |
let cookieStorage: HTTPCookieStorageProtocol | |
let currentUser: User? | |
let dataType: DateProtocol.Type | |
... | |
let mainBundle: BundleProtocol | |
let scheduler: SchedulerProtocol // Reactive.Scheduler | |
let reachability: ReachabilityProtocol // 通信状態のシグナルはグローバル | |
let userDefaults: UserDefaultsProtocol |
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
// Model is a base model that defines a primary key and timestamp on operation. | |
type Model struct { | |
XID T.XID `gorm:"type:varchar(20);primary_key" json:"id"` // XXX: XID on create callback. | |
CreatedAt T.ResourceTime `json:"createdAt"` | |
UpdatedAt T.ResourceTime `json:"updatedAt"` | |
} | |
// SoftModel is a base model to delete a record. | |
type SoftModel struct { | |
XID T.XID `gorm:"type:varchar(20);primary_key" json:"id"` // XXX: XID on create callback. |
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/bash - | |
set -o nounset # Treat unset variables as an error | |
set -x | |
env | grep ON_WATCH >/dev/null | |
if [ $? -eq 0 ]; then | |
godo server --watch | |
else | |
go install | |
go_app runConsumer |
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
// gorm.Model | |
type Model struct { | |
ID uint64 `gorm:"primary_key"` | |
CreatedAt time.Time | |
UpdatedAt time.Time | |
DeletedAt *time.Time | |
} |
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
// gorm.Model | |
//type Model struct { | |
// ID uint64 `gorm:"primary_key"` | |
// CreatedAt time.Time | |
// UpdatedAt time.Time | |
// DeletedAt *time.Time | |
//} | |
type User struct { | |
gorm.Model |
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
// MARK: UICollectionViewDelegateFlowLayout | |
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -> UIEdgeInsets { | |
return UIEdgeInsetsZero | |
} | |
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAtIndex section: Int) -> CGFloat { | |
return 2.0 | |
} |
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
// A ResponseWriter interface is used by an HTTP handler to | |
// construct an HTTP response. | |
type ResponseWriter interface { | |
// Header returns the header map that will be sent by WriteHeader. | |
// Changing the header after a call to WriteHeader (or Write) has | |
// no effect. | |
Header() Header | |
// Write writes the data to the connection as part of an HTTP reply. | |
// If WriteHeader has not yet been called, Write calls WriteHeader(http.StatusOK) |
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
@implementation APIManager | |
/*! | |
@note ネットワーク状況によって、画像ダウンロード処理の停止・再開を行う | |
*/ | |
+ (void)initialize { | |
[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { | |
switch (status) { | |
case AFNetworkReachabilityStatusReachableViaWWAN: | |
case AFNetworkReachabilityStatusReachableViaWiFi: |
NewerOlder