Skip to content

Instantly share code, notes, and snippets.

View markthree's full-sized avatar
🐳
coding

markthree markthree

🐳
coding
View GitHub Profile
@markthree
markthree / upx2px.js
Created May 13, 2025 07:29
uniapp 的 upx2px 实现
const EPS = 1e-4
const BASE_DEVICE_WIDTH = 750
let isIOS = false
let deviceWidth = 0
let deviceDPR = 0
let maxWidth = 960
let baseWidth = 375
let includeWidth = 750
function checkDeviceWidth() {
@markthree
markthree / preact.ts
Created September 30, 2023 09:10
simplest deno ssr | 最简单的 deno ssr
/** @jsxImportSource https://esm.sh/preact@10.18.0 */
import render from "https://esm.sh/preact-render-to-string@6.2.1";
const e = (
<div>
<h1>Hello, world!</h1>
</div>
);
const headers = new Headers();
@markthree
markthree / index.ts
Created September 29, 2023 04:37
Use deno to build a very simple and stable timed task with local and deno deploy support. | 使用 deno 构建一个非常简单且稳定的定时任务,支持本地和 deno deploy
import { scheduled } from "./task.ts";
scheduled({
value: 1, // initialValue
delayMs: 2000,
kv: await Deno.openKv(),
key: ["queues", "tail"],
handler(v) {
console.log(v);
return ++(v as number);