Skip to content

Instantly share code, notes, and snippets.

View KairuiLiu's full-sized avatar
🍟
Better if loaded fries.

Kairui Liu KairuiLiu

🍟
Better if loaded fries.
View GitHub Profile
@KairuiLiu
KairuiLiu / beijing-talent-settlement-decrypt.user.js
Created July 18, 2025 18:02
北京人才引进落户进度查询
// ==UserScript==
// @name 北京人才引进落户进度查询
// @namespace http://tampermonkey.net/
// @version 1.0
// @description 北京人才引进落户进度查询
// @author WhoCare?
// @match https://fw.bjrcgz.gov.cn/*
// @grant none
// ==/UserScript==
@KairuiLiu
KairuiLiu / React.js
Created March 10, 2024 12:35
Basic React Rendering and Hooks Mechanism
/**
* File: core/React.js
* Author: Kairui Liu
* Date: 2024-03-11
*/
// utils
function isTextNode(node) {
if (typeof node === 'function') return false;
@KairuiLiu
KairuiLiu / WebAuthentication.js
Last active August 20, 2025 16:49
Web Authentication Demo
let rawId = null; // store cert id (get it from server actually)
// registor
let challenge = window.crypto.getRandomValues(new Uint8Array(32));
let user = {
id: Uint8Array.from(window.atob("UZSL85T9AFC"), c=>c.charCodeAt(0)), // sample user id in Base64
name: "kairuiliu@msn.com",
displayName: "Kairui Liu",
};
let relyingParty = {
const apiInfo = Array.from(
document.getElementsByClassName('operation-tag-content')[0].children
).map((d, i) => ({
href: null,
method: d.querySelector('.opblock-summary-method').innerText.toLowerCase(),
button: getButton(i),
apiContent: d,
}));
function tryLogout(idx) {