Skip to content

Instantly share code, notes, and snippets.

View surma's full-sized avatar
🍑

Surma surma

🍑
View GitHub Profile
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
export class TelegramBot {
constructor(token) {
this.token = token;
return new Proxy(this, {
get(target, methodName, receiver) {
if (methodName === "then")
@surma
surma / .gitignore
Created February 1, 2023 15:48
Wasm GC
*.wasm
const LOOKUP =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
export function encodeBase64(buffer) {
const view = new Uint8Array(buffer);
let out = [];
for (let i = 0; i < view.length; i += 3) {
const [b1, b2 = 0x10000, b3 = 0x10000] = view.subarray(i, i + 3);
out.push(
b1 >> 2,
@surma
surma / .gitignore
Last active August 9, 2021 23:23
Getting Started with your own Understand-style puzzle
node_modules
package-lock.json
@surma
surma / .gitignore
Last active July 28, 2020 13:13
Rollup prunes dynamic import hook
build
node_modules
package-lock.json
@surma
surma / .gitignore
Last active July 28, 2020 13:05
Preloader in Rollup
package-lock.json
build
node_modules

How to download a Chrome binary for any given revision (kinda):

  1. Type in your version (something like “85.0.4173.0”) in the version information lookup field in OmahaProxy. If you don’t have the version string, this JSON lists a bunch of the most recent releases. Note that you can adjust the query parameters.
  2. Note down the resulting “Branch Base Position” (something like “778145”).
  3. Go to this page (or this one if you need more granularity), select the folder of your operating system and find the folder that has the number closest to your branch base position.

Voilá!

@surma
surma / .gitignore
Last active May 22, 2020 10:59
Countdown
/target
@surma
surma / .gitignore
Last active June 17, 2022 18:53
Moving a Three.JS-based WebXR app to a worker
node_modules
build
package-lock.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.