Skip to content

Instantly share code, notes, and snippets.

View keima's full-sized avatar
🐔
WINNER WINNER CHICKEN DINNER!

Kouta Imanaka keima

🐔
WINNER WINNER CHICKEN DINNER!
View GitHub Profile
/*
output:
JSArray<dynamic>
[{id: 1, name: John}, {id: 2, name: Jane}, {id: 3, name: Joseph}]
_JsonMap
{id: 1, name: John}
1
John
---
@echo off
setlocal enabledelayedexpansion
echo %*
for %%f in (%*) do (
set FILE_INPUT=%%~f
set FILE_OUTPUT=%%~dpf%%~nf_encode.m4v
echo input: !FILE_INPUT!
const path = require('path')
const fs = require('fs').promises
const glob = require('glob-promise')
const dayjs = require('dayjs')
const FILE_METADATA = 'info.json'
const FILE_MARKDOWN = 'README.md'
async function main() {
const metadataPaths = await glob(`./items/*/${FILE_METADATA}`)
@keima
keima / LICENSES
Created December 7, 2019 18:03
React Native orientation change listener
MIT License
Copyright (c) 2019 OTOBANK Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
class X {
id: number = 3
}
class Y {
id: number = 9
}
var x = new X()
...
dependencies {
...
// pinning dependency
configurations.all {
resolutionStrategy.force "com.google.android.gms:play-services-basement:16.0.1"
resolutionStrategy.force "com.google.android.gms:play-services-base:16.0.1"
resolutionStrategy.force "com.google.android.gms:play-services-stats:16.0.1"
resolutionStrategy.force "com.google.android.gms:play-services-gcm:16.1.0"
@keima
keima / MainActivity.kt
Last active April 18, 2020 21:48
Jetpack CameraX sample (ImageCapture)
package app.keima.android.cameraxplayground
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.view.SurfaceView
import android.view.TextureView
import android.widget.Button
import androidx.camera.core.*
import java.io.File
import net.yslibrary.licenseadapter.Library
import net.yslibrary.licenseadapter.Licenses
fun licenseList(setup: LicenseListBuilder.() -> Unit) =
LicenseListBuilder().let {
it.setup()
it.build()
}
class LicenseListBuilder {
@keima
keima / HowToUseActivity.kt
Last active March 31, 2024 21:58
LifecycleOwner implemented RecyclerView ViewHolder & Adapter (concept design)
import android.os.Bundle
import android.util.Log
import android.view.ViewGroup
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import app.keima.android.recyclerviewsandbox.databinding.ActivityMainBinding
@keima
keima / GLVideoTextureView.kt
Created March 23, 2018 14:19
ExoPlayer + GLTextureView
import android.content.Context
import android.graphics.Matrix
import android.util.AttributeSet
import com.google.android.apps.muzei.render.GLTextureView
import com.google.android.exoplayer2.SimpleExoPlayer
import timber.log.Timber
class GLVideoTextureView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null
) : GLTextureView(context, attrs), SimpleExoPlayer.VideoListener {