Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SYSX</title>
</head>
<body>
<?php
define('OTP_LEN', 6);
define('OTP_INT', 30);
define('OTP_WIN', 4);
function hotp(string $key, int $ctr, int $len = OTP_LEN)
{
$result = [];
while ($ctr !== 0) {
import { Dispatch, SetStateAction, useCallback, useEffect, useRef, useState } from 'react';
// eslint-disable-next-line @typescript-eslint/ban-types
const isFunc = (x: unknown): x is Function => typeof x === 'function';
const getState = <T>(s: T, v?: SetStateAction<T>): T | undefined => (isFunc(v) ? v(s) : v);
function useStateRealtime<T>(init: T | (() => T)): [T, Dispatch<SetStateAction<T>>, () => T];
function useStateRealtime<T = undefined>(): [
T | undefined,
Dispatch<SetStateAction<T | undefined>>,
() => T | undefined
@jamesliu96
jamesliu96 / aiirl.user.js
Last active May 30, 2024 03:27
REAL LIFE AI
// ==UserScript==
// @name AIIRL
// @version 1.0.1
// @description REAL LIFE AI
// @author jamesliu96
// @license MIT
// @namespace https://jamesliu.info/
// @homepage https://gist.github.com/jamesliu96/fcdf86b41d9bd2e768e288cb7b36744f
// @match https://www.doubao.com/*
// @match https://www.ciciai.com/*
#EXTM3U
#EXTINF:0,kexp320.mp3
https://kexp.streamguys1.com/kexp320.mp3
#EXTINF:0,kexp128.mp3
https://kexp.streamguys1.com/kexp128.mp3
#EXTINF:0,kexp160.aac
https://kexp.streamguys1.com/kexp160.aac
#EXTINF:0,kexp64.aac
https://kexp.streamguys1.com/kexp64.aac
@jamesliu96
jamesliu96 / bambient.user.js
Last active April 11, 2024 06:38
Bilibili Ambient Mode
// ==UserScript==
// @name BAMBIENT
// @version 1.1.3
// @description Bilibili Ambient Mode
// @author jamesliu96
// @license MIT
// @namespace https://jamesliu.info/
// @homepage https://gist.github.com/jamesliu96/03775eba64ff6b26efd6ee2676354f52
// @match https://*.bilibili.com/*
// @icon https://www.bilibili.com/favicon.ico
#!/data/data/com.termux/files/usr/bin/bash
proot-distro login ${1:-debian} --termux-home --shared-tmp --fix-low-ports
@jamesliu96
jamesliu96 / badtag.user.js
Last active September 12, 2024 05:59
Bilibili AD TAGging - tagging ad videos by analyzing danmaku stats
// ==UserScript==
// @name BADTAG
// @version 1.2.6
// @description Bilibili AD TAGging - tagging ad videos by analyzing danmaku stats
// @author jamesliu96
// @license MIT
// @namespace https://jamesliu.info/
// @homepage https://gist.github.com/jamesliu96/aeef912d74bdd184cbb6781f1f3939b1
// @match https://*.bilibili.com/*
// @icon https://www.bilibili.com/favicon.ico
options:
parameters:
author: jamesliu96
catch_exceptions: 'True'
category: '[GRC Hier Blocks]'
cmake_opt: ''
comment: ''
copyright: jamesliu96
description: ''
gen_cmake: 'On'
class BlobReader {
public static toBytes = (ab: ArrayBuffer) => new Uint8Array(ab);
public static EOF = new Error('EOF');
public static LOCK = new Error('LOCK');
private _remain!: Blob;
private _offset = 0;
private _end = false;