Skip to content

Instantly share code, notes, and snippets.

View sonsongithub's full-sized avatar

Yuichi Yoshida sonsongithub

View GitHub Profile
@shingohry
shingohry / ViewController.swift
Created June 11, 2019 17:13
NetworkingWithCombine
import UIKit
import Combine
/*
# References
- [ra1028/SwiftUI-Combine: This is an example project of SwiftUI and Combine using GitHub API.](https://github.com/ra1028/SwiftUI-Combine)
- [marty-suzuki/GitHubSearchWithSwiftUI: SwiftUI and Combine based GitHubSearch example.](https://github.com/marty-suzuki/GitHubSearchWithSwiftUI)
- [DataTaskPublisherを作ってみた](https://gist.github.com/yamoridon/16c1cc70ac46e50def4ca6695ceff772)
- [【iOS】Combineフレームワークまとめ(2019/6/9時点) - Qiita](https://qiita.com/shiz/items/5efac86479db77a52ccc)
*/
import Foundation
class A0 { }
class A1: A0 { }
class A2: A1 { }
class Array<X> {
func get() -> X { fatalError() }
func set(x: X) -> () { fatalError() }
}
@pyrtsa
pyrtsa / foldr.swift
Created February 24, 2015 07:55
foldr in Swift
func foldr<A : SequenceType, B>(xs: A, y: B, f: (A.Generator.Element, () -> B) -> B) -> B {
var g = xs.generate()
var next: () -> B = {y}
next = { return g.next().map {x in f(x, next)} ?? y }
return next()
}
foldr([1, 2, 3, -4, -5, 6], "") {a, b in
println(a)
return a < 0 ? toString(a) : b()
@nebuta
nebuta / halide-schedule.cpp
Created August 4, 2013 04:33
Halide simple example
// Modified from tutorials/lesson_02.cpp and test/vectorize.cpp
// On linux, you can compile and run it like so:
// g++ -I ../include -L ../bin -lHalide -lpthread -ldl -lpng blur.cpp
// LD_LIBRARY_PATH=../bin ./lesson_02
// On os x:
// g++ -I ../include -L ../bin -lHalide `libpng-config --cflags --ldflags` blur.cpp
// DYLD_LIBRARY_PATH=../bin ./lesson_02
@mapedd
mapedd / .gitignore
Created March 15, 2012 16:24
.gitignore file for files generated by Xilinx ISE IDE
#Gitignore for files generated by Xilinx ISE
*.log
*.svf
*.scr
*.cmd
*.bak
*.lso
*.elf
*.ace