Skip to content

Instantly share code, notes, and snippets.

View JBou's full-sized avatar

Gabriel Patzleiner JBou

  • 12:18 (UTC +01:00)
View GitHub Profile
@Composable
fun LocationDisplay(activity: ComponentActivity) {
// Create a conflated channel for location updates
val locationChannel = remember { Channel<Location>(Channel.CONFLATED) }
// Create a mutable state for the location text
val locationState = remember { mutableStateOf("") }
// Receive location updates from the channel using a coroutine
LaunchedEffect(locationChannel) {
val scope = CoroutineScope(Dispatchers.Default)
@Shuggy999
Shuggy999 / italiantv.m3u
Created April 17, 2023 19:10
my iptv playlist
#EXTM3U
#EXTINF:-1,Rai 1 HD [1]
https://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=2606803&output=16
#EXTINF:-1,Rai 2 HD [2]
https://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=308718&output=16
#EXTINF:-1,Rai 3 HD [3]
https://mediapolis.rai.it/relinker/relinkerServlet.htm?cont=308709&output=16
@pesterhazy
pesterhazy / building-sync-systems.md
Last active November 17, 2024 14:32
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@steelproxy
steelproxy / edtr.command
Created December 8, 2021 05:52
Script I created to get unlimited free ExpanDrive5 trials with on macOs, don't know if it still works.
clear
printf "Would you like to reset your ExpanDrive trial? (y/n): "
read PROMPT
if [ "$PROMPT" != "y" ]
then
exit
fi
printf "Killing ExpanDrive... "
pkill ExpanDrive
printf "Killed!\nResetting... "
@denis-ismailaj
denis-ismailaj / LabelledCheckBox.kt
Last active November 13, 2024 19:38
LabelledCheckBox in Jetpack Compose
@Composable
fun LabelledCheckBox(
checked: Boolean,
onCheckedChange: ((Boolean) -> Unit),
label: String,
modifier: Modifier = Modifier
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
@aartikov
aartikov / DelegateAccess.kt
Created January 14, 2021 11:03
Wrap MutableStateFlow to property delegate
internal object DelegateAccess {
internal val delegate = ThreadLocal<Any?>()
internal val delegateRequested = ThreadLocal<Boolean>().apply { set(false) }
}
internal val <T> KProperty0<T>.delegate: Any?
get() {
try {
DelegateAccess.delegateRequested.set(true)
this.get()
@rordi
rordi / root-password-MariaDB-docker-compose.md
Last active November 7, 2024 23:13
Change root password in MariaDB Docker container running with docker-compose

Change root password in MariaDB Docker container running with docker-compose

Override the entrypoint in docker-compose.yml for the MariaDB Docker container by adding:

entrypoint: mysqld_safe --skip-grant-tables --user=mysql

The start up the Docker Compose stack:

$> docker-compose up -d
@MichaelEischer
MichaelEischer / docker_host_chained_ssh.md
Last active February 2, 2024 15:15
Chain host sshd to GitLab container

Chain host sshd to GitLab container

The GitLab container comes with an embedded ssh daemon to provide secure access to the git repositories. This ssh daemon inside the container must be accessible via the ssh port (Port 22) of the host machine. However, this usually conflicts with the ssh daemon run by the host machine.

This document describes how the host and the container ssh can be chained to work nevertheless.

@Brainiarc7
Brainiarc7 / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Last active November 13, 2024 14:59
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

@jwgmeligmeyling
jwgmeligmeyling / DatabaseTestModule.java
Created May 18, 2016 22:19
Persisting recursive relationships with Hibernate
package org.hibernate.test;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.persist.PersistService;
import com.google.inject.persist.jpa.JpaPersistModule;
public class DatabaseTestModule extends AbstractModule {