Skip to content

Instantly share code, notes, and snippets.

View bisgardo's full-sized avatar

Michael Bisgaard Olesen bisgardo

  • Concordium
  • Aarhus, Denmark
View GitHub Profile
@bisgardo
bisgardo / cloudflare-wrangler.Dockerfile
Created February 19, 2023 12:24
Dockerfile for building Cloudflare Wrangler CLI
# Run from root of freshly cloned 'https://github.com/cloudflare/workers-sdk'.
FROM debian:bookworm-slim
RUN apt-get update && apt-get -y install npm libc++1 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN npm install
WORKDIR /app/packages/wrangler
RUN npm install
RUN npm run build
@bisgardo
bisgardo / node-serve-line
Created November 22, 2022 23:17
Tiny Node.js server for serving the latest line entered on stdin.
const port = process.env.PORT || 4258;
const hostname = '0.0.0.0';
let content = null;
require('http')
.createServer((req, res) => res.end(content))
.listen(port, hostname, () => console.log(`Listening on http://${hostname}:${port}`));
require('readline')
@bisgardo
bisgardo / binarydiff.go
Created September 5, 2021 11:51
Small Go program to do a binary diff between two files
package main
import (
"fmt"
"io/ioutil"
"os"
)
func unwrapPathError(err error) error {
if e, ok := err.(*os.PathError); ok {