Skip to content

Instantly share code, notes, and snippets.

View matthiasbruns's full-sized avatar
💭
working on happyann-backend

Matthias Bruns matthiasbruns

💭
working on happyann-backend
View GitHub Profile
@PacificBird
PacificBird / dioxus_append_stylesheet.rs
Last active March 10, 2023 21:17
Temporary way to easily add a stylesheet to your Dioxus (or any Rust WASM frontend project) until Dioxus-Helmet is updated to 0.3
fn append_stylesheet() {
let document = window()
.expect("Couldn't get window")
.document()
.expect("Couldn't get document");
let styles = document
.create_element("style")
.expect("Couldn't create style node");
styles
.append_with_node_1( &document.create_text_node(&include_str!("../src/style.css")))
@elizarov
elizarov / Debounce.kt
Last active August 26, 2019 00:19
Debounce
import kotlinx.coroutines.experimental.DefaultDispatcher
import kotlinx.coroutines.experimental.channels.ReceiveChannel
import kotlinx.coroutines.experimental.channels.consumeEach
import kotlinx.coroutines.experimental.channels.produce
import kotlinx.coroutines.experimental.delay
import kotlinx.coroutines.experimental.runBlocking
import kotlin.coroutines.experimental.CoroutineContext
fun <T> ReceiveChannel<T>.debounce(
wait: Long = 300,
@StefMa
StefMa / Controllers.kt
Last active October 22, 2020 16:16
BottomNavigation with Conductor
private const val ROUTER_STATES_KEY = "STATE"
/**
* This is the base implementation of a [Controller] which works hand in hand with the [BottomNavigationView].
*
* It is designed to work like that:
* * [Textual explanation](https://i.imgur.com/EqqQyOY.png)
* * [Visual explanation](https://i.imgur.com/FDb6EGU.png)
*
* In other words. It should be behave exactly like the [iOS TabBar](http://apple.co/2y6XIrL)
@VincentMasselis
VincentMasselis / DateUtil.java
Last active May 31, 2021 09:49
Simple Java 7 RFC3339 parser (Android compatible)
/*
Inspired by http://cokere.com/RFC3339Date.txt
All rights deserve to Chad Okere
*/
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;