Skip to content

Instantly share code, notes, and snippets.

View padmalcom's full-sized avatar

padmalcom padmalcom

View GitHub Profile
@padmalcom
padmalcom / gist:39a3cdd9d2d2e4d905804a600480038b
Last active April 23, 2025 15:15
Recording videos in iOS in a Kotlin Multiplatform project
// Remember to request permissions for picture gallery, image capture and audio recording
@OptIn(ExperimentalForeignApi::class)
@Composable
fun VideoScreen() {
var isRecording by remember { mutableStateOf(false) }
val output = remember { AVCaptureMovieFileOutput() }
var device = remember {
AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo).firstOrNull { device ->
@padmalcom
padmalcom / liquibase_precond_gen.py
Last active September 25, 2024 14:32
Add precondition to liquibase changesets
# pip install beautifulsoup4 lxml
# - Can handle createTable, addUniqueConstraint, and addForeignKeyConstraint
# - Every command has to be wrapped in an own changeset to be found by the script
from bs4 import BeautifulSoup
file = open("data.txt", "r")
xml = BeautifulSoup(file, 'xml')
changesets = xml.find_all('changeSet')