Skip to content

Instantly share code, notes, and snippets.

View yaroslavkulinich's full-sized avatar

Yaroslav Kulinich yaroslavkulinich

View GitHub Profile
@ghiermann
ghiermann / PolylineUtils.kt
Created August 23, 2016 08:20
Kotlin PolylineUtils - encoding/decoding of polylines, simplification with Ramer-Douglas–Peucker algorithm
data class Coordinate(val longitude: Double, val latitude: Double)
/**
* Encodes a polyline using Google's polyline algorithm
* (See http://code.google.com/apis/maps/documentation/polylinealgorithm.html for more information).
*
* code derived from : https://gist.github.com/signed0/2031157
*
* @param (x,y)-Coordinates
@rharter
rharter / SharedPreferenceLiveData.kt
Last active March 19, 2023 08:15
Creates LiveData objects that observe a value in SharedPreferences while they have active listeners.
import android.arch.lifecycle.LiveData
import android.content.SharedPreferences
abstract class SharedPreferenceLiveData<T>(val sharedPrefs: SharedPreferences,
val key: String,
val defValue: T) : LiveData<T>() {
private val preferenceChangeListener = SharedPreferences.OnSharedPreferenceChangeListener { sharedPreferences, key ->
if (key == this.key) {
value = getValueFromPreferences(key, defValue)
@robobe
robobe / cv2gst_pipe
Created December 31, 2019 20:06
send opencv frame over gstreamer pipe using python # python #gst
#!/usr/bin/env python3
import sys
import os
import cv2
import gi
import signal
import threading
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject
@All4Gis
All4Gis / QgsMultiplexorGs
Last active October 18, 2024 16:25
Python code for muxing klv and video (MISB) #STANAG #MISB #UAV
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import os
import gi
# Author : Fran Raga , 2021
# proof of concept to ingest KLV telemetry into a video. Multiplexer concept to create a MISB Video.
# Related with : https://github.com/All4Gis/QGISFMV/blob/master/code/manager/QgsMultiplexor.py
# Get Video width/Height
import androidx.compose.desktop.SwingPanel
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
import androidx.compose.material.Button
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
@Composable
fun AnimatedBorderCard(
modifier: Modifier,
contents: @Composable RowScope.() -> Unit
) {
val containerSize = 200.dp
var offsetFloat by remember { mutableStateOf(0f) }
LaunchedEffect(null) {
delay(100)
offsetFloat = containerSize.value * 10f
import androidx.compose.animation.core.EaseInOut
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.hoverable
import androidx.compose.foundation.interaction.MutableInteractionSource
@rodrigomartind
rodrigomartind / SmallDesignToolCompose.kt
Created April 14, 2023 18:53
Small Design Tool in Jetpack Compose
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
@KlassenKonstantin
KlassenKonstantin / ListSections.kt
Last active August 13, 2024 02:47
List sections
@file:OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
package de.kuno.listsections
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateRectAsState
import androidx.compose.foundation.ExperimentalFoundationApi