Skip to content

Instantly share code, notes, and snippets.

View jamolkhon's full-sized avatar

Jamolkhon Khakimov jamolkhon

View GitHub Profile
@jamolkhon
jamolkhon / bundle-extensions.kt
Last active November 26, 2018 10:35
building an android bundle from map (most likely doesn't work, i haven't checked yet)
@SuppressLint("NewApi")
@Suppress("UNCHECKED_CAST")
fun Map<String, Any?>.toBundle(): Bundle = Bundle().apply {
this@toBundle.forEach { entry ->
val (key, value) = entry
when (value) {
is Boolean -> putBoolean(key, value)
is Int -> putInt(key, value)
is Byte -> putByte(key, value)
is Char -> putChar(key, value)
package com.mygdx.game
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.InputAdapter
import com.badlogic.gdx.Screen
import com.badlogic.gdx.ScreenAdapter
import com.badlogic.gdx.graphics.GL20
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.math.Vector2
import com.badlogic.gdx.physics.box2d.*
import org.web3j.crypto.Credentials
import org.web3j.crypto.Keys
import java.util.*
import java.util.concurrent.Executors
fun main(args: Array<String>) {
val threads = 4
val pool = Executors.newFixedThreadPool(threads)
val lock = object {}
for (i in 1..threads) {