Skip to content

Instantly share code, notes, and snippets.

View thebino's full-sized avatar
😉

Benjamin Stürmer thebino

😉
View GitHub Profile
@thebino
thebino / Cargo.toml
Last active October 1, 2023 05:33
[Rust] Testing multipart/form-data with axum
[package]
name = "test-multipart"
version = "0.1.0"
edition = "2021"
[dependencies]
axum = { version = "0.6.20", features = ["multipart"] }
tokio = { version = "1.32.0", features = ["full"] }
mime = "0.3.17"
log = "0.4.20"
@thebino
thebino / CenterSliderComposable
Created April 5, 2023 07:42
A center slider in Jetpack compose starting in the center of the slider and having percentage values
package composables
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.gestures.draggable
import androidx.compose.foundation.gestures.rememberDraggableState
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.offset
@thebino
thebino / MainActivity.kt
Last active August 8, 2022 06:07
Intrinsics layout to constrain a row by width
package com.example
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyRow
@thebino
thebino / MainActivity.kt
Last active June 25, 2022 05:08
[Jetpack Compose] Using a swipeableState within a CoordinatorLayout will not detect any swipe gestures
package com.example.compose
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.height
@thebino
thebino / README.MD
Last active December 19, 2020 06:02
TonUINO - Selfmade Toniebox

Selfmade Toniebox

Toniebox ist ein würfelförmiges, für Kinder konzipiertes Tonabspielgerät mit sehr einfacher Bedienung. Das Gerät wird seit 2016 von der Firma Boxine GmbH mit Sitz in Düsseldorf vertrieben.

Contra

  • teure Figuren (~15€)
  • eigene Figuren nicht unterstützt
  • eigene "Aufzeichnungen" werden als Eigentum der Fa. Boxine GmbH (Speicherung der Daten auf deren Servern)

Gradle Kotlin DSL

This is small overview how to migrate your groovy buildfiles into Kotlin DSL.

Using the Kotlin DSL for gradle build files improves the editors typing experience in many ways. First of all, the groovy syntax doesn't support refactoring nor auto-completion while editing in most IDEs.

Build import Syntax highlighting Semantic editor
IntelliJ IDEA
import argparse
import sqlite3 as lite
import os
def _open_db(db):
try:
con = lite.connect(db)
cur = con.cursor()
return (cur,con)
except lite.Error as e: