Skip to content

Instantly share code, notes, and snippets.

terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
version = "2.20.3"
}
}
}
variable "nginx_image_tag" {
@godhand4826
godhand4826 / jsFuck.js
Last active March 16, 2024 10:07
A jsFuck transpiler written in 20 lines.
let dict = {};
const digit = (d) => '(+[])' + '+(+!![])'.repeat(d);
const number = (n) => `+(${n.toString().split('').map(d => `[${digit(+d)}]`).join('+')})`;
const fill = (s) => eval(s).split('').forEach((c, i) => (dict[c] ??= `(${s})[${number(i)}]`));
const word = (s) => s.split('').map(c => dict[c] ?? c.is.not.exist.in.dict).join('+');
// at -> constructor -> return btoa -> toString -> fromCharCode -> *
fill('[]+![]'); // "false"
fill('[]+!![]'); // "true"
fill(`[]+[][${word('at')}]`); // "function at() { [native code] }"
@godhand4826
godhand4826 / wrapper.go
Last active June 24, 2021 03:20
Wrapping typed context in gorilla/mux
package wrapper
import (
"net/http"
"github.com/gorilla/mux"
)
// wrapper
type ContextWraper struct {