Skip to content

Instantly share code, notes, and snippets.

@haydenhhyc
haydenhhyc / mcc_status.md
Last active December 2, 2025 02:47
MCC Status

MCC Status Logic (Draft)

metadata key: mccStatus

Scenario breakdown

Non-MCC

  • NonMCC

Regular MCC (MCC3)

@haydenhhyc
haydenhhyc / token_failure.md
Last active August 5, 2025 07:31
Tokenisation Failure Query (DataPrime)

MCC2 Auto-Capture

Token Not Created

source logs
| filter ($d.cx_rum.log_context.message ~ 'MCC2MakeMccPaymentUseCase: Did not create card token')
| extract $d.cx_rum.log_context.data into $d.data using jsonobject()
| create $d.error from $d.data['MCC2MakeMccPaymentUseCase.errorCondition']
| create $d.pspReference from $d.data['MCC2MakeMccPaymentUseCase.pspReference']
| create $d.caused_by from (
    if($d.error == null || $d.error == '', 
@haydenhhyc
haydenhhyc / incremental_update.md
Last active June 25, 2024 07:17
Android Incremental Update

Android-Incremental-Update

Proof-of-concept(s) for implementing incremental update on private Android apps without using the Google Play store.

One of the difficulties of maintaining a private app (which does not publish to the Google Play store) is to implement a updating scheme. With Google Play store, the logic of app update is handled by the ingenious minds at Google, and for us developers, whenever we build a new version, we simply upload the latest APK to the store, and we done. However with a private app, we'll have to do it ourselves.

@haydenhhyc
haydenhhyc / #pi_setup.md
Last active December 30, 2025 20:19
Raspberry Pi Media Server Setup

Raspberry Pi Media Server Setup

How to setup Pi to serve RGB and Thermal footage from cameras.

We're using the Logitech webcam c270 and Seek Compat for RGB and Thermal respectively.

1. Setup RTSP Server

Download mediamtx binary from: https://github.com/bluenviron/mediamtx/releases Latest version is v1.8.3 as of writing, change it accordingly.

@haydenhhyc
haydenhhyc / adb_cookbook.md
Last active January 25, 2025 13:18
ADB Cookbook

ADB Cookbook

Some may-be-useful adb commands

# Open Android settings screen
adb shell am start -a com.android.settings.TTS_SETTINGS

# Set default Text-to-Speech (TTS) engine
adb shell settings put secure tts_default_synth <tts_engine>
adb shell settings put secure tts_default_synth com.google.android.tts  # set to Google TTS
@haydenhhyc
haydenhhyc / PermissionWrapper.kt
Created December 1, 2023 04:14
Composable that ask for permission
/**
* Wrapper composable for checking permissions at runtime
*/
@OptIn(ExperimentalPermissionsApi::class)
@Composable
fun PermissionWrapper(
activity: ComponentActivity,
composable: @Composable () -> Unit,
) {
val permissionStates = rememberMultiplePermissionsState(