Skip to content

Instantly share code, notes, and snippets.

View 53ningen's full-sized avatar
🐰
Is the Order a Rabbit?

gomi_ningen 53ningen

🐰
Is the Order a Rabbit?
View GitHub Profile
@53ningen
53ningen / test
Last active February 4, 2023 19:46
["test1", "test2", "test3", "test4", "@demo"]
@53ningen
53ningen / twipla.js
Last active January 17, 2019 11:08
twipla の参加者名とtwitter ID を CSV 形式で引っこ抜くスクリプト
// twipla のイベントページを開いて、Chrome Developer Tool より以下を実行
console.log(j$(".float_left.member_list.round_border li").toArray().map((e) => [e.textContent.trim(), e.lastChild['href'].slice(24, e.lastChild['href'].length)].join(',')).join("\n"))
// 出力を CSV 形式で保存してエクセルで開く

この資料はラビットハウス社内で開催される、iOSアプリ開発未経験者向けのハンズオン会向けに作成されたものです。このハンズオンを一通り行うことにより、iOS開発において以下のことができるようになります。

  • 基本的なUIKitコンポーネントの利用
    • UILabel: テキストの表示
    • UIButton: ボタンの表示
    • UIImage: 画像の表示
    • UITableView: テーブルの表示
    • StoryboardとAuto Layoutの利用: UIをデザインベースで構成する仕組み
    • プッシュ遷移とモーダル遷移: iOSの大きな2つの画面遷移パターン
  • 非同期処理: ユーザーの操作感を妨げずに、裏側で処理を走らせるなど
indirect enum TailRec<T> {
case Done(T)
case More(() -> TailRec<T>)
func run() -> T {
var tailRec = self
while true {
switch tailRec {
case .More(let next): tailRec = next()
case .Done(let t): return t
/// `* -> *`
public class K1<A> { public init() {} }
public protocol Functor {
associatedtype A
associatedtype B
associatedtype FB = K1<B>
func fmap(f : A -> B) -> FB
}
; your code goes here
(define (square x) (* x x))
(define (sum-of-square x y) (+ (square x) (square y)))
(define (q13 x y z) (cond
((and (>= y x) (>= z x)) (sum-of-square y z))
((and (>= x y) (>= z y)) (sum-of-square x z))
(else (sum-of-square x y))
))
### nil check for boolean
```
% cat ./NilCheckForBoolean.swift
import Foundation
func target() {
for _ in 1...100000 {
let e: Bool? = true
if e == nil { }
import Swift
import Foundation
let observable = BehaviorSubject(value: "cocoa")
let observer = AnyObserver<String> {
switch $0 {
case .Next(let str): NSLog(str)
default: break
}
}
enum Hoge {
case Next
case Error
}
func piyo(arg: Hoge?) -> Bool {
return arg != nil
}
func foo(arg: Bool) -> Bool {
@53ningen
53ningen / Hoge
Last active April 10, 2016 09:53
; ModuleID = 'Hoge'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9"
%Vs5Int32 = type <{ i32 }>
%Sp = type <{ i8* }>
%swift.type = type { i64 }
%swift.type_pattern = type opaque
%swift.protocol_conformance = type { i32, i32, i32, i32 }
%swift.protocol = type { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i32, i32 }