Skip to content

Instantly share code, notes, and snippets.

View yshrsmz's full-sized avatar

Yasuhiro SHIMIZU yshrsmz

View GitHub Profile
@yshrsmz
yshrsmz / IntrospectionQuery.gql
Last active April 22, 2019 04:45
GitHub GraphQL API schema
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name
@yshrsmz
yshrsmz / 1_common.kt
Last active April 13, 2019 05:43
Multiplatform ViewModel
expect abstract class ViewModel() {
open fun onCleared()
}
@yshrsmz
yshrsmz / 0_common.kt
Created March 4, 2019 06:50
SQLDelight Kotlin Multiplatform Project sample
internal expect fun <B> backToFront(b: () -> B, job: (B) -> Unit)
package com.codingfeline.sample
import co.touchlab.stately.concurrency.ThreadLocalRef
import co.touchlab.stately.concurrency.value
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Runnable
import platform.darwin.dispatch_async
import platform.darwin.dispatch_get_main_queue
import platform.darwin.dispatch_queue_t
import kotlin.coroutines.CoroutineContext
package com.codingfeline.sample
import android.os.Build
import org.junit.Test
import org.junit.runner.RunWith
import org.kodein.di.Kodein
import org.kodein.di.KodeinAware
import org.kodein.di.erased.bind
import org.kodein.di.erased.instance
import org.kodein.di.erased.provider
// androidMain/BuildKonfig.kt
package com.codingfeline.githubdata
import kotlin.String
actual object BuildKonfig {
actual val GITHUB_TOKEN: String = "hogehoge"
}
@yshrsmz
yshrsmz / QueryWithParam.gql
Last active January 16, 2019 04:05
kgql - GraphQL Wrapper generator for Kotlin MPP, https://github.com/yshrsmz/kgql
query User(
$login: String!,
$name: Int,
$id: String = "",
$company: String = null,
$foo: Float,
$logins: [String]) {
user(login: $login) {
id
login
041785fe5d85008ca918df1f9ef7feee0d034905aa2a7543836dbcc5bb64c4f6ea844c692f80a1f81344d402c24f9447422d1c1c1e5fb36d241842eeeea8733a3c
@yshrsmz
yshrsmz / ViewModelFactory
Created November 7, 2017 04:59
ViewModelFactory and Dagger
package net.yslibrary.omnitweety.base
import android.arch.lifecycle.ViewModel
import android.arch.lifecycle.ViewModelProvider
import javax.inject.Inject
import javax.inject.Provider
import javax.inject.Singleton
/**
* Created by yshrsmz on 2017/07/22.
java.lang.AssertionError: Compilation produced the following errors:
/SOURCE_OUTPUT/tiamat/compiler/NoTableNameSharedPreferences.java:7: エラー: シンボルを見つけられません
import tiamat.Preference;
^
シンボル: クラス Preference
場所: パッケージ tiamat
/SOURCE_OUTPUT/tiamat/compiler/NoTableNameSharedPreferences.java:8: エラー: シンボルを見つけられません
import tiamat.RxSharedPreferences;
^
シンボル: クラス RxSharedPreferences