Skip to content

Instantly share code, notes, and snippets.

View andhikayuana's full-sized avatar
🌏
bertapa

Andhika Yuana andhikayuana

🌏
bertapa
View GitHub Profile
@andhikayuana
andhikayuana / UsbData.java
Created June 25, 2025 08:08 — forked from felHR85/UsbData.java
An easy to use android solution to get a readable representation of Usb vid (vendor name) and pid (product name). Data is collected and stored in a local SQLite database from http://www.linux-usb.org/usb-ids.html
public class UsbData
{
private String vendorId;
private String vendorName;
private String productId;
private String productName;
public UsbData(String vendorId, String vendorName, String productId, String productName)
{
{
"name": "Tiktok Downloader",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "bot/hook",
"options": {}
},
"type": "n8n-nodes-base.webhook",
@andhikayuana
andhikayuana / emulator-install-using-avdmanager.md
Created May 29, 2025 04:44 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

Kotlin Flow Cheat Sheet

Flow Types

Flow Type Purpose Key Features Use Case
flow {} Creates a cold flow that emits values lazily. Emits values only when collected.
Supports suspending functions.
Creating custom flows to emit data on demand.
flowOf() Creates a flow from a fixed set of values. Emits provided values sequentially.
Cold by nature.
Emit predefined values (e.g., configuration settings).
asFlow() Converts collections, sequences, arrays, or ranges to flows. Supports many standard types.
Cold by nature.
Convert lists or arrays into flows for processing.
`c
/**
* Simple XML parser
* @param {String} xml
* @return {Object}
*/
function parseXML(xml) {
var beg = -1;
var end = 0;
var tmp = 0;
@andhikayuana
andhikayuana / InitChannelsBroadcastReceiver.kt
Created October 6, 2024 14:30 — forked from ademirqueiroga/InitChannelsBroadcastReceiver.kt
InitChannelsBroadcastReceiver implementation
class InitChannelsBroadcastReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent?) {
if (defaultChannelAlreadyAdded) {
// Make sure we are not trying to re-create the channel if it's already added.
// You can save this on your shared preferences or database.
return
}
val channelHelper = PreviewChannelHelper(context)
val channel = Channel.Builder()
.setType(TvContractCompat.Channels.TYPE_PREVIEW)
@andhikayuana
andhikayuana / worksheet-generators.md
Created September 25, 2024 04:46 — forked from lewdev/worksheet-generators.md
🏫📄 Worksheet Generators List
@andhikayuana
andhikayuana / Main.kt
Created August 30, 2024 21:53 — forked from alexfacciorusso/Main.kt
Start recording Skia frames in SKP files from Kotlin Compose Desktop
fun main() = application {
Window(onCloseRequest = ::exitApplication) {
LaunchedEffect(Unit) {
window.attachSkiaDebugger()
}
MaterialTheme {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.background(Color.LightGray).height(IntrinsicSize.Min)
) {
@andhikayuana
andhikayuana / compress_video
Created August 22, 2024 09:51 — forked from trvswgnr/compress_video
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
@andhikayuana
andhikayuana / Scrollbar.kt
Created July 24, 2024 08:59 — forked from mxalbert1996/Scrollbar.kt
Modifiers to draw scrollbars in Jetpack Compose
/*
* MIT License
*
* Copyright (c) 2022 Albert Chang
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is