Skip to content

Instantly share code, notes, and snippets.

@storyn26383
storyn26383 / HTMLBuilder.ts
Last active April 15, 2022 09:47
Metaprogramming
import { html as beautify } from 'js-beautify'
type childCallback = (builder: HTMLBuilder) => void
declare function manipulate(content: string): void
declare function manipulate(content: string, attributes: Record<string, string>): void
declare function manipulate(callback: childCallback): void
declare function manipulate(callback: childCallback, attributes: Record<string, string>): void
class Tag {
private name: string
@storyn26383
storyn26383 / des.ts
Last active July 9, 2021 09:59
Algorithms for Functional Programming
type PermutationTable = Array<number>
type SBox = Array<Array<number>>
type CanCastToBigInt = number | bigint | string | BigNumber
const CHAR_BITS = 16
const DES_BITS_LIMIT = 64
const BITS_ROTATION_TABLE: Array<number> = [
1, 1, 2, 2, 2, 2, 2, 2,
1, 2, 2, 2, 2, 2, 2, 1,
apiVersion: v1
kind: ConfigMap
metadata:
name: ingress-nginx-config
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
data:
enable-real-ip: "true"
class Container {
static get proxyHandler () {
return {
get (target, prop) {
if (prop in target) {
return Reflect.get(...arguments)
}
return target.resolve(prop)
}