Skip to content

Instantly share code, notes, and snippets.

Avatar
🎆
魔法をかけて

Jack Works Jack-Works

🎆
魔法をかけて
View GitHub Profile
@Jack-Works
Jack-Works / 2018.js
Last active May 14, 2021
cRAzY eSnEXt (*all* proposals mixed in)
View 2018.js
#! Aaaaaaaaaaa this is JS!!!
// https://github.com/tc39/proposal-hashbang
// This file is mixing all new syntaxes in the proposal in one file without considering syntax conflict or correct runtime semantics
// Enjoy!!!
// Created at Nov 23, 2018
for await(const x of (new A // https://github.com/tc39/proposal-pipeline-operator
|> do { // https://github.com/tc39/proposal-do-expressions
case(?) { // https://github.com/tc39/proposal-pattern-matching
when {val}: class {
View npm.detect.js
// ==UserScript==
// @name NPM detect ESM TS sideEffects
// @namespace http://tampermonkey.net/
// @version 0.3
// @description
// @author Jack Works
// @match https://www.npmjs.com/*
// @grant GM_xmlhttpRequest
// @require https://unpkg.com/@holoflows/kit@0.6.0
// @connect unpkg.com
@Jack-Works
Jack-Works / explain.md
Last active Nov 12, 2020
FAQ: Why TypeScript is correct? / Why TypeScript cannot express this?
View explain.md

Frequently asked TypeScript question

I think my code is correct! Why it is complaining type error to me?

How can I do something in TypeScript?

Case 1: Add function

function add<T extends number | bigint>(left: T, right: T): T {
@Jack-Works
Jack-Works / pause-on-exception.js
Last active Jun 7, 2020
Pause on exception, with catch, async version
View pause-on-exception.js
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms))
}
async function err() {
await sleep(200)
// debugger: pause on uncaught exception
// should pause on this
throw new Error("wow")
}
function err2() {
@Jack-Works
Jack-Works / index.js
Created Dec 29, 2019
Dave Conservatoire helper
View index.js
// ==UserScript==
// @name Dave Conservatoire helper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.daveconservatoire.org/*
// @grant none
// ==/UserScript==
// Including https://github.com/kapetan/browser-beep/blob/master/index.js
@Jack-Works
Jack-Works / bilibili.js
Last active Oct 27, 2019
bilibili speed 3.0x
View bilibili.js
// ==UserScript==
// @name Bilibili 调速度
// @namespace http://tampermonkey.net/
// @version 0.4
// @description try to take over the world!
// @author Jack Works
// @match https://www.bilibili.com/video/*
// @grant none
// @require https://unpkg.com/@holoflows/kit@0.6.0
// ==/UserScript==
View keybase.md

Keybase proof

I hereby claim:

  • I am jack-works on github.
  • I am jackworks (https://keybase.io/jackworks) on keybase.
  • I have a public key ASDid3LDQ_-Qiag1yi8FnATJA0_BoUSuC3VWiEw3jDvd1Ao

To claim this, I am signing this object: