This file contains 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 { Server } from "https://deno.land/[email protected]/http/server.ts"; | |
const port = 4505; | |
const handler = (request: Request) => { | |
const body = `Your user-agent is:\n\n${request.headers.get( | |
"user-agent", | |
) ?? "Unknown"}`; | |
return new Response(body, { status: 200 }); | |
}; | |
const server = new Server({ host: '0.0.0.0', port, handler }); | |
const certFile = "cert.pem"; |
This file contains 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 * as ows from "https://deno.land/x/[email protected]/mod.ts"; | |
import { trace, SpanKind, propagation, context, TextMapGetter, ROOT_CONTEXT, SpanContext } from "https://deno.land/x/[email protected]/opentelemetry/api.js"; | |
type KvRealtimeEvent = | |
| { | |
type: 'insert' | 'replace'; | |
appliedAt: Date; | |
key: Deno.KvKey; | |
value: unknown; | |
versionstamp: string; |
This file contains 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
{"position":500,"title":"Funeral","artist":"Arcade Fire","year":"2004","label":"MERGE"} | |
{"position":499,"title":"Ask Rufus","artist":"Rufus, Chaka Khan","year":"1977","label":"ABC"} | |
{"position":498,"title":"Suicide","artist":"Suicide","year":"1977","label":"RED STAR"} | |
{"position":497,"title":"The Indestructible Beat of Soweto","artist":"Various Artists","year":"1985","label":"EARTHWORKS"} | |
{"position":496,"title":"Dónde Están los Ladrones","artist":"Shakira","year":"1998","label":"COLUMBIA"} | |
{"position":495,"title":"II","artist":"Boyz II Men","year":"1991","label":"MOTOWN"} | |
{"position":494,"title":"Presenting the Fabulous Ronettes","artist":"The Ronettes","year":"1964","label":"PHILLES"} | |
{"position":493,"title":"Here, My Dear","artist":"Marvin Gaye","year":"1978","label":"TAMLA/MOTOWN"} | |
{"position":492,"title":"Nick of Time","artist":"Bonnie Raitt","year":"1989","label":"CAPITOL"} | |
{"position":491,"title":"Fine Line","artist":"Harry Styles","year":"2019","label":"COLUMBIA"} |
This file contains 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
! 2021-11-26 lets make stuff work | |
! page autotranslate | |
@@||translate.google.com/gen204 | |
! datadog RUM | |
@@||rum-http-intake.logs.datadoghq.eu^$ping | |
! google analytics | |
@@||www.google-analytics.com^ |
This file contains 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
FROM node:18-slim | |
WORKDIR /app | |
COPY package.json ./ | |
RUN npm install | |
COPY index.js ./ | |
ENTRYPOINT ["node", "."] |
This file contains 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
interface ChangedResource { | |
address: string; | |
module_address: string; | |
mode: "data" | "managed"; | |
type: string; | |
name: string; | |
index?: number | string; | |
provider_name: string; | |
change: { |
This file contains 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
FROM hayd/alpine-deno:1.10.1 | |
WORKDIR /src/app | |
ADD deps.ts ./ | |
RUN ["deno", "cache", "deps.ts"] | |
ADD *.ts ./ | |
RUN ["deno", "cache", "mod.ts"] | |
ENTRYPOINT ["deno", "run", "--unstable", "--allow-net", "--allow-hrtime", "--allow-env", "--cached-only", "--no-check", "mod.ts"] |
This file contains 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
/ # time apk update | |
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz | |
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz | |
v3.13.1-111-g435a742679 [https://dl-cdn.alpinelinux.org/alpine/v3.13/main] | |
v3.13.1-108-gc0a920aca7 [https://dl-cdn.alpinelinux.org/alpine/v3.13/community] | |
OK: 13880 distinct packages available | |
real 0m 0.52s | |
user 0m 0.25s | |
sys 0m 0.04s |
This file contains 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
// variable we want to narrow | |
const { channel } = {} as Record<string,string | undefined>; | |
// if this simpler definition is used instead, it's all ok | |
// const channel: undefined | string = 'hi'; | |
// method returning never | |
const api = {} as { cancel(): never; }; | |
if (!channel) api.cancel(); |
This file contains 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 signals = [ | |
Deno.signal(Deno.Signal.SIGINT), | |
Deno.signal(Deno.Signal.SIGTERM), | |
]; | |
const cleaningUp = Promise.race(signals).then(() => { | |
signals.forEach(x => x.dispose()); | |
}); | |
console.log('Module running...'); |
NewerOlder