Skip to content

Instantly share code, notes, and snippets.

View lucacasonato's full-sized avatar
🖥️
Programming

Luca Casonato lucacasonato

🖥️
Programming
View GitHub Profile
export function greeter(name?: string) {
console.log("Hello" + (name ? " " + name : "") + "!");
}
export function example(param?: string) {
return "test";
}
const test = "hello";
export { test };
@lucacasonato
lucacasonato / deno_doc_polyfill.ts
Last active April 15, 2020 17:41
Deno.doc pollyfill
export enum DocNodeKind {
Function = "function",
Variable = "variable",
Class = "class",
Enum = "enum",
Interface = "interface",
TypeAlias = "typeAlias",
Namespace = "namespace",
}
export interface DocNodeLocation {
Deno.utime();
function decorate(target: any) {}
@decorate
class Foo {}
@lucacasonato
lucacasonato / deno.ts
Last active June 2, 2020 20:09
Read text from body
import { serve } from "https://deno.land/std@0.55.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
const decoder = new TextDecoder();
for await (const req of s) {
const body = await Deno.readAll(req.body);
const str = decoder.decode(body);
console.log(`Body: ${str}`);
req.respond({ body: str });
}
@lucacasonato
lucacasonato / README.md
Created July 18, 2020 12:34
Run oak in a worker

deno run -A --unstable ./main.ts

@lucacasonato
lucacasonato / Cargo.lock
Created July 18, 2020 20:57
reqwest max http2 connections bug
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "adler"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
[[package]]
name = "alloc-no-stdlib"
setInterval(() => console.log(import.meta.url), 1000);