Skip to content

Instantly share code, notes, and snippets.

View yjwong's full-sized avatar

Wong Yong Jie yjwong

View GitHub Profile
@yjwong
yjwong / dsdt.dsl
Created June 24, 2023 19:29
Patched DSDT for UM3402YA for CS35L42
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20200925 (64-bit version)
* Copyright (c) 2000 - 2020 Intel Corporation
*
* Disassembling to symbolic ASL+ operators
*
* Disassembly of dsdt.dat, Sat Jun 17 23:19:04 2023
*
* Original Table Header:
@yjwong
yjwong / gist:fc837e35a88d666eb342aa001bdca9a9
Created June 24, 2023 19:27
Brain dump of debugging why AX200 Bluetooth is missing under Linux
Key E slot
Key A+E cards
/sys/devices/pci0000:00/0000:00:08.1/0000:04:00.4
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 13d3:5463 IMC Networks USB2.0 HD UVC WebCam
Bus 001 Device 002: ID 04f3:0c6e Elan Microelectronics Corp. ELAN:Fingerprint
@yjwong
yjwong / WebpackAssetsPlugin.ts
Created April 15, 2023 04:31
Redirect missing Webpack assets to S3 bucket
import * as path from 'path';
import * as Boom from '@hapi/boom';
import { plugin as H2O2 } from '@hapi/h2o2';
import * as Hapi from '@hapi/hapi';
export interface WebpackAssetsPluginOptions {
bundleStore: {
enabled: boolean;
uri: string;
@yjwong
yjwong / gist:e5f8b9cc20c0547dc13b817b27e4e48a
Created March 5, 2023 20:03
Things I found on the ASUS UM3402
#define ASUS_WMI_DEVID_CAMERA_LED 0x60079
#define ASUS_WMI_DEVID_FANL_CTRL 0x110019
-> 0x1 whisper mode
-> 0x2 performance mode
-> 0x3 balanced mode
@yjwong
yjwong / sre_task.md
Last active January 5, 2022 11:08

Cold Storage Group Ordering

Cold Storage is a popular supermarket chain in Singapore. As part of an employee benefit, Glints employees located in Singapore are given a fixed weekly office budget to purchase groceries to fill the office pantry. Unfortunately, the Cold Storage website does not have a group ordering function, which makes collating the list of items to buy a hassle.

To solve this problem, you proposed creating a service that everyone in the

@yjwong
yjwong / basebackup.go
Last active June 6, 2020 16:19
Code to perform base backups of PostgreSQL
type baseBackupResult struct {
StartPosition pglogrepl.LSN
TimelineID uint8
Tablespaces []baseBackupResultTablespace
}
type baseBackupResultTablespace struct {
SpaceOID *uint32
SpaceLocation string
Size *uint8
@yjwong
yjwong / main.go
Last active October 6, 2019 10:17
Use 3 or 4 finger gestures on Ubuntu
package main
// #cgo pkg-config: libinput
/*
#include <errno.h>
#include <fcntl.h>
#include <libinput.h>
#include <poll.h>
#include <unistd.h>
@yjwong
yjwong / Dockerfile
Created February 7, 2019 16:54
Dockerfile for Padavan RT-N56U Toolchain
FROM ubuntu:18.04
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
autoconf \
automake \
bison \
build-essential \
ca-certificates \

Keybase proof

I hereby claim:

  • I am yjwong on github.
  • I am yjwong (https://keybase.io/yjwong) on keybase.
  • I have a public key whose fingerprint is 307A 8764 0CD7 D72C 8950 8ADD 7DCF 7FF2 7951 688E

To claim this, I am signing this object:

@yjwong
yjwong / nus_transcript_request_fix.js
Last active August 29, 2015 14:13
Fix for the broken NUS Transcript Request Form
/**
* How to use:
* 1) Go to the page with the broken form using Google Chrome.
* 2) Press F12 to open Developer Tools.
* 3) Click the "Console" tab.
* 4) Copy the entirety of this file.
* 5) Paste into the Developer Tools window.
* 6) Press Enter.
* 7) ???
* 8) PROFIT!!!