Skip to content

Instantly share code, notes, and snippets.

@alimsk
alimsk / channel.ts
Created August 25, 2021 03:32 — forked from iwasaki-kenta/channel.ts
Go-like channels in TypeScript.
export class Deferred<T> {
promise: Promise<T>;
resolve: (value?: T | PromiseLike<T>) => void;
reject: (reason?: any) => void;
constructor() {
this.promise = new Promise((resolve, reject) => {
this.resolve = resolve;
this.reject = reject;
});
@alimsk
alimsk / signals.ts
Last active August 29, 2021 20:18
linux signal (typescript/js)
// it's fucking hard to find this piece of shit
const signals = {
SIGHUP: 1,
SIGINT: 2,
SIGQUIT: 3,
SIGILL: 4,
SIGTRAP: 5,
SIGABRT: 6,
SIGIOT: 6,
SIGBUS: 7,
@alimsk
alimsk / go-os-arch.md
Created July 4, 2021 13:35 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.14.7 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • aix
  • android