Skip to content

Instantly share code, notes, and snippets.

View kt3k's full-sized avatar

Yoshiya Hinosawa kt3k

View GitHub Profile
@kt3k
kt3k / mod.ts
Created April 28, 2021 02:58
fetch deploy error repro
self.addEventListener("fetch", (event) => {
event.respondWith(fetch('http://google.com'))
});
@kt3k
kt3k / deploy.ts
Last active April 21, 2021 04:54
no-cache-script-repro
addEventListener("fetch", (e) => {
const pathname = new URL(e.request.url).pathname;
switch (pathname) {
case "/foo.ts": {
e.respondWith(new Response("export {}", {
headers: {
"content-type": "application/typescript",
"x-typescript-types": "/foo.d.ts"
}
}));
https://deno.land/x/[email protected]/cli.ts
https://cdn.dreg.dev/package/@rollup/[email protected]
https://cdn.dreg.dev/package/@rollup/[email protected]/types/index.d.ts
https://cdn.dreg.dev/package/@types/[email protected]
https://deno.land/[email protected]/fs/copy.ts
https://deno.land/[email protected]/fs/mod.ts
https://deno.land/[email protected]/fs/copy.ts
https://deno.land/[email protected]/fs/mod.ts
https://deno.land/x/[email protected]/cli.ts
https://deno.land/x/[email protected]/deps/mod.ts
a
import { serve } from "https://deno.land/x/[email protected]/mod.ts";
serve({
"/": () => new Response("lib.deno.d.ts"),
"/builtin/:version": (_request, params) => {
return new Response(fetch(`https://github.com/denoland/deno/releases/download/${params.version}/lib.deno.d.ts`));
},
404: () => new Response("not found"),
});
import { PartialReadError } from "https://raw.githubusercontent.com/kt3k/deno_std/c6ea83bc2cd457d930653d5788a26c82000c3d58/io/bufio.ts";
addEventListener("fetch", (e) => {
e.respondWith(new Response(PartialReadError.name))
})
|- (p -> r) | (q -> r) -> (p & q -> r)
---
(p -> r) | (q -> r) |- p & q -> r
---
(p -> r) | (q -> r), p & q |- r
---
(p -> r) | (q -> r), p, q |- r
---1-1
p -> r, p, q |- r
---
@kt3k
kt3k / bucketlist.md
Last active December 14, 2020 06:30
My bucket list

Bucket List:

  • Get PhD in mathematics
  • Create a language for expressing mathematical theorems and proofs efficiently and naturally (I didn't like matamath or Coq because they didn't look like "mathematics")
  • Release a cross-platform artistic game app in both iOS App Store and Google Play
@kt3k
kt3k / tasks.toml
Last active November 12, 2020 05:48
tasks.ts
import { toml } from 'https://deno.land/x/tasks/mod.ts';
toml`
[lint]
desc = ""
cmd = "deno run tools/lint.js"
env = { RUST_BACKTRACE = 1 }
[build]
desc = ""
@kt3k
kt3k / win-dev-env-setup.md
Last active October 30, 2020 12:40
win-dev-env-setup

Launch Microsoft Windows Server 2019 Base from EC2 console (with more than 40GB disk space).

Start powershell and run:

iwr -useb git.io/setup.ps1 | iex

This installs Visual Studio 2019, Python 2.7, Rust, Node.js (necessary dependencies for Deno development).