Skip to content

Instantly share code, notes, and snippets.

View RodrigoHahn's full-sized avatar
🪳
The world!!

RodrigoHahn

🪳
The world!!
View GitHub Profile
@alexaandru
alexaandru / chi.go
Created February 14, 2024 16:40
Chi-like syntactic sugar layer on top of stdlib http.ServeMux
// Chi-like syntactic sugar layer on top of stdlib http.ServeMux.
package main
import (
"net/http"
"slices"
)
type (
middleware func(http.Handler) http.Handler
@adtac
adtac / Dockerfile
Last active December 26, 2025 00:20
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@khalidx
khalidx / node-typescript-esm.md
Last active March 6, 2026 02:32
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@chapmanjacobd
chapmanjacobd / gitls.md
Last active December 26, 2025 00:21
a few interesting git commands

gitls

git ls-files --sparse --full-name -z | 
  xargs -0 -I FILE -P 20 git log --date=iso-strict-local --format='%ad %>(14) %cr %<(5) %an  %h ./FILE' -- FILE | 
  sort --general-numeric-sort

This lists the files and hashes for each git commit and file:

2021-12-05T13:32:32-06:00  1 year, 11 months ago  Jacob Chapman  cc91fa0 ./.gitattributes

2021-12-05T13:32:32-06:00 1 year, 11 months ago Jacob Chapman cc91fa0 ./.gitignore

@gboncoffee
gboncoffee / main.c
Created August 7, 2023 15:03
Example of crazy use of multiple calls to main() and cli args.
/*
* Maybe this should be illegal? This is a program that RETURNS the factorial of
* the number of cli args it receives, by recursivelly calling main.
*
* License: The Unlicense License
* Original author: Gabriel G. de Brito
*/
int main(int argc, char *argv[])
{
@gboncoffee
gboncoffee / uwufiew.c
Last active August 14, 2023 13:04
UwUfiew algorithm
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
/*
* uwufiew, weceives inpuwut fwom standawt inpuwut ow fiwes and concatenates a
* uwufiewd vewsion to the standawt ouwutpuwut.
*
* fwee softwawe, wincesed uwundew the MIT wicense, youwu shouwuwd have
* weceived a copy of the wicense awong with the pwogwam.
@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active January 7, 2026 22:07
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
WHEN WILL BROWSERS BE COMPLETE?
A short exploration into the end game of web browsers.
This article may seem to be about bashing Google but it isn't. It's just about
reflecting on the current state and how much longer we should see ourselves
here.
So what is the Web? Well we can agree the Web is a conglomerate of standards
proposed by the W3C. So what do those standards define?
@leon0707
leon0707 / react.html
Created January 18, 2020 20:40
react starter
<!DOCTYPE html>
<html>
<body>
<div id="root"></div>
<script src="https://unpkg.com/react@16.3.2/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16.3.2/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js" charset="utf-8"></script>
<script type="text/babel">
function Greeter(props) {
return <div>Hello {props.user}</div>;