Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sys1yagi's full-sized avatar

Toshihiro Yagi sys1yagi

View GitHub Profile
public inline fun <T, R> T.nullWithBlock(block: T.() -> Unit): R? = run {
block()
null
}
@sys1yagi
sys1yagi / kotlin.md
Last active June 7, 2017 08:50
object, companion object, top level(package level)の使い分け

object

シングルトンの代替え (Dagger通さなくてもいいやつ)

companion object

staticの代替え

例えばHogeActivity.createIntent()など あと定数とかね

@sys1yagi
sys1yagi / Usage.kt
Created May 12, 2017 04:28
Magic Data Binding inflate
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val binding = parent.inflateBinding<ListItemCommentBinding>()
return ViewHolder(binding)
}
inline fun withBeforeAfter(
before: () -> Unit,
after: () -> Unit,
block: () -> Unit
) {
before()
block()
after()
}
// for processing program.
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2ES2;

全体の雑感

一言でいうと「1万円払う価値のある最高品質のゴミ」最高に良いけど最悪。これはプレイしてみないとわからないので買ってください。

チャプター1

ガーディナまでは体験版との差分はとくになかった。王都襲撃のムービーにキングスグレイブのものが追加されたくらいか。その後インソムニアに戻ろうとして戦闘してCMでやってた帝国軍がインソムニアにファーって飛んでいくシーンがある感じ。はじまったなって感じで期待感があった。

チャプター2

package kotlinx.coroutines.android
import rx.Observable
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers
fun asyncAndroid(
coroutine c: RxController<Unit>.() -> Continuation<Unit>
) {
val controller = RxController<Unit>()
@sys1yagi
sys1yagi / fabfile.py
Last active November 14, 2016 00:51 — forked from shikajiro/fabfile.py
Script to perform the build of Android on another machine
# Script Name : fabfile.py
# Author : shikajiro
# Created : 2016-11-03
# Last Modified : 2016-11-03
# Version : 1.0.0
# Modifications :
# Description :
# Script to perform the build of Android on another machine
# By performing such a build of severely time on another machine,
# it is possible to ensure the CPU resources of the development machine,
  • 音楽の歴史
  • 各国の音楽
  • 作曲理論
    • 楽曲分析
    • 音楽理論
    • 楽典
    • 和声
    • 非和声音
  • テンション
fun given(description: String, given: Given.() -> Unit) {
given.invoke(Given())
}
class Given {
fun on(description: String, on: On.() -> Unit) {
on.invoke(On())
}
}