Skip to content

Instantly share code, notes, and snippets.

View Miha-x64's full-sized avatar
🍵
へ‿(◉‿◉)‿ㄏ

Mike Miha-x64

🍵
へ‿(◉‿◉)‿ㄏ
View GitHub Profile
package net.aquadc.commonandroid.lists;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.mikepenz.itemanimators.DefaultAnimator;
/**
* ItemAnimator implementation which animates items so it looks like they're falling into list.
package net.aquadc.commonandroid
import android.content.res.Resources
import java.text.SimpleDateFormat
import java.util.*
/**
* Returns text representation of `Date` and time (in millis)
* after which this value should be updated;
* time can be -1, which means that no update will ever be needed
class MainActivity : AppCompatActivity(),
NavigationView.OnNavigationItemSelectedListener, FragmentManager.OnBackStackChangedListener {
private lateinit var drawer: DrawerLayout
private lateinit var toggle: ActionBarDrawerToggle
private lateinit var navigation: NavigationView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@Miha-x64
Miha-x64 / ImDate.kt
Last active August 30, 2017 17:08
Immutable Date subclass
package net.aquadc.common
import java.util.*
import kotlin.DeprecationLevel.ERROR
import kotlin.UnsupportedOperationException as UOE
/**
* Created by mike on 17.02.17
*/
@Miha-x64
Miha-x64 / Handlecutor.java
Last active May 22, 2018 15:21
It is an android.os.Handler and java.util.concurrent.Executor at the same time.
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import java.util.concurrent.Executor;
public class Handlecutor extends Handler implements Executor {
public Handlecutor(@NonNull Looper looper) {
package whatever
import com.google.gson.Gson
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import com.google.gson.reflect.TypeToken
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.Converter
import retrofit2.Retrofit
@Miha-x64
Miha-x64 / unblend.rs
Last active April 18, 2019 08:30
Rust script for extracting a transparent colour from the given pre-blent opaque colours
use std::env;
use std::io;
use std::io::Write;
use std::str::FromStr;
#[macro_use]
extern crate lazy_static;
fn main() {
Index: app/src/main/java/com/techyourchance/multithreading/demonstrations/designcoroutines/ProducerConsumerBenchmarkUseCase.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/src/main/java/com/techyourchance/multithreading/demonstrations/designcoroutines/ProducerConsumerBenchmarkUseCase.kt (revision ce962bc96a3224ae27ff8c94ba658946362ce852)
+++ app/src/main/java/com/techyourchance/multithreading/demonstrations/designcoroutines/ProducerConsumerBenchmarkUseCase.kt (date 1572347476000)
@@ -1,17 +1,16 @@
package com.techyourchance.multithreading.demonstrations.designcoroutines
@Miha-x64
Miha-x64 / BoundService.kt
Last active January 5, 2020 14:48
Boilerplate for bound services (may become a part of http://github.com/Miha-x64/Flawless) later
package net.aquadc.flawless.service
import android.app.Service
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.os.Binder
import android.os.IBinder
/**
import kotlinx.collections.immutable.PersistentMap
import kotlinx.collections.immutable.PersistentSet
import kotlinx.collections.immutable.persistentSetOf
import kotlinx.collections.immutable.toPersistentMap
import org.assertj.core.api.Assertions.assertThat
import org.junit.Test
class Day18ManyWorldsInterpretation {
/**