Skip to content

Instantly share code, notes, and snippets.

@avwie
avwie / ultimate-guitar-backing-tracks.js
Created August 30, 2023 18:52
Download Ultimate Guitar Backing Tracks
// copy and paste this in the browser window console and execute, when you are on the page of the song WITH official backing track
await (async function () {
function download(blob, fileName) {
const url = window.URL.createObjectURL(blob);
const tempLink = document.createElement('a');
tempLink.href = url;
tempLink.setAttribute('download', fileName);
document.body.appendChild(tempLink);
tempLink.click();
@avwie
avwie / DragIssue.kt
Created April 28, 2023 11:39
A minimal example showing the lagging drag issue
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.gestures.onDrag
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
@Composable fun Sidebar(
expanded: Boolean = true,
content: @Composable SidebarScope.() -> Unit = {}
) {
Column (
verticalArrangement = Arrangement.spacedBy(Dimensions.DefaultPadding / 2),
modifier = Modifier
.doubleBorder()
.background(Colors.Sidebar.Background)
.padding(Dimensions.DefaultPadding)
@avwie
avwie / ComponentBag.kt
Created February 26, 2021 17:45
Usage of companion objects
package nl.avwie
interface Tag<T>
interface Tagged<T> {
val tag: Tag<T>
}
class ComponentBag {
private val components = mutableMapOf<Tag<*>, Any>()