Skip to content

Instantly share code, notes, and snippets.

View rock3r's full-sized avatar
🤌

Sebastiano Poggi rock3r

🤌
View GitHub Profile
@rock3r
rock3r / 00-LAYOUT.md
Created September 18, 2026 07:08
Compose Multiplatform Desktop recreation of Kavsoft Chat Bubble Transition (right-anchored SE arc, list shove, white composer)

Chat Bubble Transition (Compose Multiplatform Desktop)

Kavsoft-style send morph: composer → bubble along a right-anchored SE Bezier, with list shove-aside.

Drop these into a CMP Desktop project

composeApp/src/commonMain/kotlin/chatbubble/ChatApp.kt  ← ChatApp.kt
composeApp/src/jvmMain/kotlin/chatbubble/Main.kt          ← Main.kt
composeApp/build.gradle.kts ← composeApp.build.gradle.kts
@rock3r
rock3r / svg2gif.sh
Created May 18, 2026 19:39
Script that renders an animated SVG to an animated GIF
#!/usr/bin/env zsh
# "THE BEER-WARE LICENSE" (Revision 42):
# Seb wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp
# Default Configurations
FPS=30
DURATION=0 # 0 means auto-detect via LCM
@rock3r
rock3r / MavenIndexAnalyzer.main.kts
Created January 14, 2026 19:30
A Kotlin script that fetches all unique versions on Maven Central and outputs a csv with added semver compliance info
@file:Repository("https://repo1.maven.org/maven2/")
@file:DependsOn("org.apache.maven.indexer:indexer-reader:7.1.5")
@file:DependsOn("org.slf4j:slf4j-simple:2.0.13")
import org.apache.maven.index.reader.ChunkReader
import java.io.*
import java.net.URL
import java.nio.channels.Channels
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.Executors
@rock3r
rock3r / lists.md
Created May 8, 2025 15:04
Nested lists example

Nested bullet lists:

  • Hello, level 1
    • Hello, level 2
    • Another level 2
      • Surprise! Level 3
      • It keeps going, when...
        • Level 4!
          • Level 5!
    • And a third one level 2
  • Another level 1
@rock3r
rock3r / BoxyButton.kt
Created December 7, 2024 15:25
Boxy button: a custom "raised" Compose button
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Sebastiano Poggi wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/
package dev.sebastiano.boxybutton
@rock3r
rock3r / highlights.md
Created February 6, 2024 11:05
Malformed highlight blocks tests
@rock3r
rock3r / DrawText.kt
Created August 20, 2023 10:38
Draw text on a bitmap
@OptIn(ExperimentalAnimationApi::class)
@Composable
private fun DrawText(it: PaddingValues) {
Column(Modifier.padding(it)) {
var text by remember { mutableStateOf("Vel eum voluptatem nulla. Ut enim unde sit autem laboriosam consequatur ut. Quo eius veniam occaecati minima. Porro architecto et omnis. Et dolor qui non. Tempora et consequuntur ea quia iste qui ducimus cum.\n") }
OutlinedTextField(value = text, onValueChange = { text = it.trim() })
val baseFontSizePx = with(LocalDensity.current) { 24.sp.toPx() }
val context = LocalContext.current
var bitmap by remember { mutableStateOf<ImageBitmap?>(null) }
@rock3r
rock3r / hvac_toggle.yaml
Created August 6, 2023 11:33
Home Assistant blueprint to turn a HVAC on or off based on a binary sensor
blueprint:
name: HVAC automation
source_url: https://gist.github.com/rock3r/5954b87184c6536bb8f2ea922bc97f02
description: Turn a HVAC on or off based on a binary sensor
domain: automation
input:
opening_sensor:
name: Window/Door sensor
description: The window or door sensor to use to drive the Tado valve
selector:
@rock3r
rock3r / svg2icns.sh
Created July 17, 2023 16:43
A macOS Bash script to generate an icns file (macOS app icons) from an svg file
#! /bin/bash
#----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Seb
# ----------------------------------------------------------------------------
# Inspired by http://www.spaziocurvo.com/2015/03/svg-to-icns-script-for-mac-os-x/
# and https://gist.github.com/plroebuck/af19a26c908838c7f9e363c571199deb
@rock3r
rock3r / LoadResource.kt
Created July 7, 2023 13:46
JVM (Desktop) resource loading, for resources living in a different classloader
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Sebastiano Poggi wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. Seb
* ----------------------------------------------------------------------------
*/
/**