This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
using UnityEngine.AddressableAssets; | |
namespace AssetLoader | |
{ | |
[RequireComponent(typeof(AudioSource))] | |
public class AudioSourceLoader : MonoBehaviour | |
{ | |
[SerializeField] private AssetReferenceAudioClip audioClip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.android.livedata | |
import androidx.lifecycle.LiveData | |
import androidx.lifecycle.MutableLiveData | |
import kotlin.properties.ReadOnlyProperty | |
import kotlin.reflect.KProperty | |
abstract class LiveDataEditor<R> { | |
fun <T> propertyOf() = LiveDataProperty<T>() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
cd %~dp0 | |
setlocal | |
set CMD=adb devices | |
for /f "usebackq tokens=1,2,3*" %%a in (`%CMD%`) do ( | |
if "%%b" == "device" ( | |
set DEVICE_ID=%%a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(SpringRunner::class) | |
@SpringBootTest | |
@AutoConfigureWebTestClient | |
class ExampleTests { | |
@Autowired | |
private lateinit var client: WebTestClient | |
@Test | |
fun test_of_get() { | |
client.get().uri("/api/todo") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
launch { | |
loadAllFiles() | |
} | |
} | |
fun launch(block: suspend () -> Unit) { | |
block.startCoroutine(object : Continuation<Unit> { | |
override val context: CoroutineContext get() = EmptyCoroutineContext | |
override fun resume(value: Unit) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Extension | |
// Why is keyword `class` instead of `object`? | |
// Because we can use the `foo` function after importing `FooExtension.foo`. | |
class FooExtension : Extension { | |
fun String.foo(): String = "Foo${this}" | |
} | |
class BarExtension : Extension { | |
fun String.bar(): String = "Bar${this}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
external interface MethodMap | |
inline operator fun MethodMap.get(propertyName: String): Function<Any>? = this.asDynamic()[propertyName] | |
inline operator fun MethodMap.set(propertyName: String, value: Function<Any>?) { | |
this.asDynamic()[propertyName] = value | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sample$lambda() { | |
return 'Bar'; | |
} | |
function sample() { | |
var v1 = 'Foo'; | |
var v2 = sample$lambda; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example | |
import com.example.mapper.json.JsonObjectMapper | |
import org.springframework.boot.SpringApplication | |
import org.springframework.boot.autoconfigure.SpringBootApplication | |
import org.springframework.boot.web.support.SpringBootServletInitializer | |
import org.springframework.context.annotation.Bean | |
import org.thymeleaf.spring4.SpringTemplateEngine | |
import org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver | |
import org.thymeleaf.spring4.view.ThymeleafViewResolver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CMD=`basename $0` | |
usage() { | |
echo "Usage: $CMD [-r script] [-d dst] [-s src]" 1>&2 | |
} | |
COMMAND= | |
DST= |
NewerOlder