Skip to content

Instantly share code, notes, and snippets.

const { ccclass, property } = cc._decorator;
const floor = (n: number) => ~~n;
const round = (n: number) => floor(n + 0.5);
function HSVtoRGB(h: number, s: number, v: number) {
let r: number,
g: number,
b: number,
i: number,
export const flatten = (arr) => [].concat(...arr);
function* _flatten(arr) {
for (const item of arr) {
if (Array.isArray(item)) {
yield* _flatten(item);
} else {
yield item;
}
}
class Hourglass {
private ticker: ([number] | [number, number])[] = [];
public tic() {
const d = this.ticker.slice(-1)[0];
if (!this.ticker.length || d[1]) {
this.ticker.push([Date.now()]);
}
}
type Vec2 = { x: number; y: number };
type Rect = Vec2 & { width: number; height: number };
class Strip {
public rect: Rect;
public pos: Vec2 = { x: 0, y: 0 };
public energy = 0;
public constructor(rect: Rect) {
if (rect.height < 0) rect.height = 0;
var __s = document.createElement('style'); __s.type = 'text/css'; __s.innerText = `body, #app {
background-color: #121212 !important;
color: #666666 !important;
}
.bilibili-player {
box-shadow: 0 0 8px #080808 !important;
}
.nav-mask {
background-color: #222222 !important;
}
8.7.198.45/32
31.13.64.0/18
46.82.174.68/32
59.24.3.173/32
64.13.192.0/18
66.220.144.0/20
67.15.0.0/16
67.228.0.0/16
69.171.224.0/19
69.63.176.0/20
<?php
/* the minimal router - mrt.php | @jamesliu96 | GPL */
$path = urldecode(parse_url(preg_replace('/\/+/', '/', $_SERVER['REQUEST_URI']), PHP_URL_PATH));
function route(string $rule, callable $callback)
{
global $path;
if ($path === $rule) {
<?php
function cache(string $content) {
$filemtime = filemtime(__FILE__);
$length = strlen($content);
$etag = '"'.dechex($filemtime).'-'.dechex($length).'"';
$modified = gmdate("D, d M Y H:i:s", $filemtime)." GMT";
if ($_SERVER['HTTP_IF_NONE_MATCH'] === $etag || $_SERVER['HTTP_IF_MODIFIED_SINCE'] === $modified) {
http_response_code(304);
exit;
This file has been truncated, but you can view the full file.
Q$$OO!>!!!!:!:::!7>>>>!!!!>!:--?$$$$$QQ$$$$C>------!!---COO>OOCCO7CCCCCO$$$$$$C>:$$$>77??-O$?7!?OQCC
Q$$OO!!!!>!:!!:::>!!:::!::!!>$$$$$$O$$$QO?O>?-:-->$OO$$C--!$$OC?!O:CCO$O$$OC$$$C>---!>>7??>777?QQQHH
$$$OO!!!!!:!!:::-:::------::!O$C$$$$COO$$$$$C?COOCCCCO$$OCC$C$7---?O?C$C?OO$$O$>??$7:!!>?!7?>>7$QQQH
$$OOO:!!!!!!!!!::-::----7Q$?O$$$COO$$O$OCQ$$C$--::----:!C$$Q$77C>$CC?$$OO?COOO$7:?$$$>!>!>>>7!!$QQQH
$$OOO::!::!!!!:::--------::CO$$QO$Q$O?OOO$OC>!>>!!!!!::!7?$HNOC?$C>C?:O>7?C>CC$O:-::O?C7:!>>!>!$$QQH
$$OOC::::::::::::----------->OOOOOQQO!?O$?HO>>>!!!>>!:!!CO$HH?OO?CO$O$$>:CC$:>$>::::::::::>>!>!$$QQQ
$$OOO-------::-----------?C7::?OOOC$C->O??!Q>>7O$>??>>>>>$QHN?C$Q?CC>C?:!?QQ$::---:::::::!!!!>!$$QQQ
$$$OO-----------------?QQQQ$>!7>?O?CO!:$OO:777?Q!O77>>!!777QN?C?7?C?7?:-7C7OCC:::::::::::!!!!!!$$QQH
Q$$OO---::!:--::::::--:CO?--:7!?!!?C:--!C7CC?C77>!$7>?!>>77:>C>>!CCOOC7:::!$QO7:::::::::::!!!!!$$QQH
Q$$$O:::::::>!::::!:::::-:--::>OC>CC$--7C>>?77>>>>!>>>>>>>>7>O>7$QOOQ$$$OC$O77O?>:::::::::::>>7$$QQH
<?php
define('OTP_LEN', 6);
define('OTP_INT', 30);
define('OTP_WIN', 4);
function hotp(string $key, int $counter, $len = OTP_LEN)
{
static $alphabet = [
'A' => 0, 'B' => 1,