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 / 20161107.sh
Last active November 7, 2016 05:41
佐倉綾音さんの音声を保存するシェルスクリプト
#!/bin/sh
wget http://www.morinaga.co.jp/cocoa/milk/message.ogg
wget http://nbcuni-audio.edgesuite.net/20161107.mp3
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
}

夏のアレ

アドリア海周辺都市(ベネツィア・ドブロブニク)+アルザス(ストラスブール・コルマール)コース

概要

日次 日付 国・地域 行程
1 8/19(FRI) 東京〜フランクフルト〜ミュンヘン〜インスブルック インスブルック泊
; 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 }