Skip to content

Instantly share code, notes, and snippets.

View Sophoun's full-sized avatar
😀

Sophoun Nheum Sophoun

😀
View GitHub Profile
@Sophoun
Sophoun / DeviceType.kt
Created September 26, 2025 05:31 — forked from stevdza-san/DeviceType.kt
Adaptive layout in Compose Multiplatform.
import androidx.compose.material3.adaptive.HingeInfo
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
import androidx.window.core.layout.WindowSizeClass
sealed class DeviceType : Comparable<DeviceType> {
abstract val minWidth: Int
abstract val minHeight: Int
abstract val rank: Int
override fun compareTo(other: DeviceType): Int = this.rank - other.rank
/**
* A custom slider composable that allows selecting a value within a given range.
*
* @param value The current value of the slider.
* @param onValueChange The callback invoked when the value of the slider changes.
* @param modifier The modifier to be applied to the slider.
* @param valueRange The range of values the slider can represent.
* @param gap The spacing between indicators on the slider.
* @param showIndicator Determines whether to show indicators on the slider.
* @param showLabel Determines whether to show a label above the slider.
@Sophoun
Sophoun / playstore_flutter_gitlabci.md
Created January 20, 2025 03:22 — forked from enzo-santos/playstore_flutter_gitlabci.md
Play Store + GitLab CI tutorial

Play Store + GitLab CI tutorial

This tutorial will teach you how to deploy a Flutter-based app to Play Store using GitLab CI.

Glossary

If you encounter a variable you don't recognize while reading, take a look here.

Variable name Description
@Sophoun
Sophoun / EndlessLazyColumn.kt
Created December 17, 2024 15:27 — forked from giorgospat/EndlessLazyColumn.kt
Jetpack Compose component for endless vertical list
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
@Sophoun
Sophoun / pipewire.md
Created September 27, 2023 04:05 — forked from the-spyke/pipewire.md
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@Sophoun
Sophoun / Convert Android ImageProxy to Bitmap in Java.java
Created September 1, 2023 05:59 — forked from Ahwar/Convert Android ImageProxy to Bitmap in Java.java
This Java code converts android's ImageProxy to Bitmap.
private Bitmap toBitmap(Image image) {
Image.Plane[] planes = image.getPlanes();
ByteBuffer yBuffer = planes[0].getBuffer();
ByteBuffer uBuffer = planes[1].getBuffer();
ByteBuffer vBuffer = planes[2].getBuffer();
int ySize = yBuffer.remaining();
int uSize = uBuffer.remaining();
int vSize = vBuffer.remaining();
@Sophoun
Sophoun / README.md
Created May 31, 2023 10:00 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@Sophoun
Sophoun / To get android key hash code
Created December 26, 2022 16:38 — forked from sanjogshrestha/To get android key hash code
To get android key hash code and To get Certificate fingerprint(MD5)
To get android key hash code follow these steps
Download the openssl for windows
now unzip to c drive
open cmd prompt
type cd C:\Program Files\Java\jdk1.6.0_26\bin
then type only
keytool -export -alias myAlias -keystore C:\Users\your user name\.android\myKeyStore | C:\openssl-0.9.8k_WIN32 \bin\opens sl sha1 -binary | C:\openssl-0.9.8k_WIN32\bin\openssl enc -a -e
@Sophoun
Sophoun / Web Development Contract.md
Created November 30, 2021 04:38 — forked from joeguilmette/Web Development Contract.md
Web Development Contract

Web Design Contract

Based on Contract Killer, an open-source contract for web developers.

Summary:

I’ll always do my best to fulfill your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. I have no desire to trick you into signing something that you might later regret. What I do want is what’s best for both parties, now and in the future.

So in short;

You ([CLIENT COMPANY]), located at [CLIENT ADDRESS] are hiring me ([DEVELOPER]) located at [DEVELOPER ADDRESS] to design and develop a web site for the estimated total price of [QUOTE] as outlined in our previous correspondence.

@Sophoun
Sophoun / solve.sh
Created December 2, 2020 12:22 — forked from BookGin/solve.sh
Ubuntu 18.04 Bionic Netplan Wifi Not Working
# https://gist.github.com/austinjp/9b968c75c3e54004be7cd7a134881d85
# make sure your wifi SSID and password are correct again
vim /etc/netplan/01-netcfg.yaml
# this package should solve all the problem
apt install wpasupplicant
# generate and apply the config file
netplan apply
# remember to enable the device
ip link set wlp2s0 up