Skip to content

Instantly share code, notes, and snippets.

View kuroyam's full-sized avatar

Shun Kuroda kuroyam

  • GMO Pepabo, Inc.
  • Tokyo
View GitHub Profile
@available(iOS 13.0, OSX 10.15, *)
struct Grid<Data, Content>: View where Data: RandomAccessCollection, Content: View, Data.Index == Int, Data.Element: Identifiable {
private let data: [GridData<Data>]
private let column: Int
private let content: (Data.Index, Data.Element) -> Content
init(_ data: Data, column: Int = 2, content: @escaping (Data.Index, Data.Element) -> Content) {
self.column = column
self.content = content
import UIKit
protocol GETProtocol {
associatedtype GETArguments
static func get(_ args: GETArguments)
}
protocol POSTProtocol {
associatedtype POSTArguments
static func post(_ args: POSTArguments)
@kuroyam
kuroyam / APIClient.swift
Last active August 28, 2015 09:18
雑なやつ
class APIClient {
static func request(endpoint: Endpoint, parameters: Dictionary<String, String>?, handler: (result: Result) -> Void) {
// ここで通信
}
}
enum Endpoint {
case Login
case Feed(String, Method)
// Playground - noun: a place where people can play
import Cocoa
enum Suit : Int {
case Spade, Club, Heart, Diamond
func toString() -> String {
switch self {
case .Spade:
@kuroyam
kuroyam / gist:f6bfb826f2b232d4c631
Last active December 26, 2021 09:37
スクエニモバイルカンファレンスに行ってきたまとめ

スクエニモバイルカンファレンス

※メモなのでタイプミスとか間違ってるとことかよくわからないところもある

cocos2d-x最新事情

v3.xの魅力 スライドは後日調整できたら公開

  • C++11
  • callbackをstd::functionに
@kuroyam
kuroyam / AEPositionExporter.jsx
Last active May 27, 2018 01:09
AfterEffectsのコンポジション内の全レイヤー座標をplist形式で出力。 左上が原点の座標系(cocos2dの場合はwindowのheightから引く必要あり)。
// AEPositionExporter.jsx
function exportPositionData(comp)
{
var layers = comp.layers;
var file = new File("position.plist");
if (file.open("w")) {
@kuroyam
kuroyam / AppDelegate.h
Created May 19, 2013 04:23
cocos2dのGLViewをViewController単位で生成・破棄できるようにするためのコード
#import <UIKit/UIKit.h>
#import "cocos2d.h"
@class GameViewManager;
@interface AppController : NSObject <UIApplicationDelegate>
{
UIWindow *window_;
}