This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| BEGIN{B:{$_=<<'STRAP'; chomp; exit (eval() // exit print STDERR $@)}} | |
| #line 4 "STDIN" | |
| my $payload = "/tmp/payload"; | |
| last unless $0 eq "-"; | |
| my $F; do { local $^F=9999; open($F, '>', $payload) or die "$payload: $!" }; | |
| $payload //= "/proc/self/fd/" . fileno($F); | |
| chmod(0744, $F) or die "$payload: $!"; | |
| $/="\n__END__\n"; | |
| print $F <<EVAL, scalar <STDIN> or die "$payload: $!"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| use v5.26; | |
| use Errno qw(EAGAIN EWOULDBLOCK EINTR); | |
| use Fcntl qw(O_WRONLY); | |
| STDOUT->autoflush(1); | |
| # This is a tool like cat, except that it watches for STDOUT close and exits | |
| # immediately. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export type AppendV1<Tuple extends unknown[], Last> = | |
| Tuple extends [infer _1] ? [_1, Last] : | |
| Tuple extends [infer _1, infer _2] ? [_1, _2, Last] : | |
| Tuple extends [infer _1, infer _2, infer _3] ? [_1, _2, _3, Last] : | |
| Tuple extends [infer _1, infer _2, infer _3, infer _4] ? [_1, _2, _3, _4, Last] : | |
| Tuple extends [infer _1, infer _2, infer _3, infer _4, infer _5] ? [_1, _2, _3, _4, _5, Last] : | |
| Tuple extends [infer _1, infer _2, infer _3, infer _4, infer _5, infer _6] ? [_1, _2, _3, _4, _5, _6, Last] : | |
| Tuple extends [infer _1, infer _2, infer _3, infer _4, infer _5, infer _6, infer _7] ? [_1, _2, _3, _4, _5, _6, _7, Last] : | |
| Tuple extends [infer _1, infer _2, infer _3, infer _4, infer _5, infer _6, infer _7, infer _8] ? [_1, _2, _3, _4, _5, _6, _7, _8, Last] : | |
| Tuple extends [infer _1, infer _2, infer _3, infer _4, infer _5, infer _6, infer _7, infer _8, infer _9] ? [_1, _2, _3, _4, _5, _6, _7, _8, _9, Last] : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Concat<U extends unknown[], V extends unknown[]> = { | |
| 0: V, | |
| 1: { | |
| 0: U, | |
| 1: [U[0], V[0]], | |
| 2: [U[0], V[0], V[1]], | |
| 3: [U[0], V[0], V[1], V[2]], | |
| 4: [U[0], V[0], V[1], V[2], V[3]], | |
| 5: [U[0], V[0], V[1], V[2], V[3], V[4]], | |
| 6: [U[0], V[0], V[1], V[2], V[3], V[4], V[5]], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import alias from "@rollup/plugin-alias"; | |
| import commonjs from "@rollup/plugin-commonjs"; | |
| import resolve from "@rollup/plugin-node-resolve"; | |
| import typescript from "@rollup/plugin-typescript"; | |
| import { createFilter } from "@rollup/pluginutils"; | |
| import surplusCompiler from "surplus/compiler"; | |
| function surplus({ include, exclude, sourceMap = false }) { | |
| const filter = createFilter(include, exclude); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Benchmark = require("benchmark"); | |
| console.log("setup"); | |
| var suite = new Benchmark.Suite(); | |
| class TestInheritance extends Set { | |
| constructor() { super() } | |
| op(q) { this.add(q) } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type BuildOptions = { | |
| watch?: boolean; | |
| preserveWatchOutput?: boolean; | |
| listFiles?: boolean; | |
| listEmittedFiles?: boolean; | |
| pretty?: boolean; | |
| traceResolution?: boolean; | |
| diagnostics?: boolean; | |
| extendedDiagnostics?: boolean; | |
| generateCpuProfile?: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Obj = { | |
| id?: string; | |
| name?: string; | |
| child: undefined | { | |
| id?: string; | |
| } | |
| parent: Obj | undefined; | |
| } | |
| // --------- assertAllDefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use utf8; | |
| use warnings; | |
| use v5.30; | |
| use experimental qw(signatures); | |
| use FindBin; | |
| use Linux::Inotify2; | |
| use Time::HiRes qw(ualarm); | |
| unless(@ARGV) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env scriptisto | |
| (await import("source-map-support")).default.install(); | |
| import * as fs from "fs"; | |
| fs.writeFileSync("/dev/stderr", "hello world!\n"); | |
| // scriptisto-begin | |
| // script_src: main.ts | |
| // build_once_cmd: npm install | |
| // build_cmd: npx tsc -p . |