Skip to content

Instantly share code, notes, and snippets.

View ThanosFisherman's full-sized avatar

Thanos Psaridis ThanosFisherman

View GitHub Profile
/*
* Copyright 2026 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@binrebin
binrebin / MarkdownPreview.kt
Last active January 5, 2026 15:18
Simplest markdown parser for android jetpack compose.
@Composable
fun MarkdownPreview(text: String) {
val context = LocalContext.current
val annotatedString = parseMarkdownToAnnotatedString(text)
var textLayoutResult by remember { mutableStateOf<TextLayoutResult?>(null) }
Text(
text = annotatedString,
modifier = Modifier
@AdnanHabibMirza
AdnanHabibMirza / NetworkMonitor.kt
Last active July 22, 2024 13:45
Monitor network connectivity in android using callbackFlow.
interface NetworkMonitor {
val isOnline: Flow<Boolean>
}
class NetworkMonitorImpl @Inject constructor(
@ApplicationContext private val context: Context,
@Dispatcher(IO) private val ioDispatcher: CoroutineDispatcher,
) : NetworkMonitor {
override val isOnline: Flow<Boolean>
get() = callbackFlow {
@notnotrobby
notnotrobby / cgp.md
Last active January 22, 2026 02:33
List of free resources to study computer graphics programming.
@mmolosay
mmolosay / LoadingButton.kt
Last active November 12, 2025 10:31
Animated button with loading indicator in Jetpack Compose
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.Transition
import androidx.compose.animation.core.VisibilityThreshold
import androidx.compose.animation.core.animateDp
import androidx.compose.animation.core.spring
import androidx.compose.animation.core.updateTransition
import androidx.compose.animation.expandHorizontally
import androidx.compose.animation.fadeIn
@stevdza-san
stevdza-san / HyperlinkText.kt
Last active October 25, 2025 12:56
Embedd a Hyperlink within a Text using Jetpack Compose.
import androidx.compose.foundation.text.ClickableText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.TextUnit
@mcroteau
mcroteau / build.gradle.kts
Created February 21, 2022 21:43
Example Kotlin DSL for publishing to Maven Central with Dokka and Sources
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.jetbrains.dokka") version "1.6.10"
id("maven-publish")
id("java-library")
id("signing")
id("jacoco")
application
kotlin("jvm") version "1.6.10"
@tatumroaquin
tatumroaquin / archlinux-qemu-kvm.md
Last active January 22, 2026 13:33
QEMU-KVM Installation for Arch Linux

QEMU-KVM in Arch Linux

Check Virtualization Support

lscpu | grep -i Virtualization
  • VT-x for Intel
  • AMD-Vi for AMD

Ensure that your kernel includes KVM modules

@the-spyke
the-spyke / pipewire.md
Last active November 30, 2025 03:52
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

const recorder = new Tone.Recorder();
const synth = new Tone.Synth().connect(recorder);
// start recording
recorder.start();
// generate a few notes
synth.triggerAttackRelease("C3", 0.5);
synth.triggerAttackRelease("C4", 0.5, "+1");