Skip to content

Instantly share code, notes, and snippets.

import java.io.File
import java.io.InputStream
import java.util.LinkedList
const val EOF_SYMBOL = -1
const val ERROR_STATE = 0
const val SKIP_VALUE = 0
const val NEWLINE = '\n'.code
import java.io.InputStream
import java.util.LinkedList
const val EOF_SYMBOL = -1
const val ERROR_STATE = 0
const val SKIP_VALUE = 0
const val EOF_VALUE = -1
const val A_VALUE = 1
const val B_VALUE = 2
@brokenpylons
brokenpylons / dual.ml
Last active January 4, 2023 12:07
Direct implemention of the extended dual regular expressions due to Alexander Okhotin
(* Extended dual regular expressions (Alexander Okhotin: The dual of concatenation).
The dual of constants is their complement.
The dual of the union is the intersection defined as DualUnion (x, y) = (Comp (Union (Comp x) (Comp y))).
The dual of the concatenation is defined analogously as DualConcat (x, y) = (Comp (Concat (Comp x) (Comp y))).
Other dual operations are constructed out of these duals in the customary way.
The duals are essentially just the "upside-down" versions of the operations.
The derivatives of the dual operations are constructed out of the duals in the customary way.
@schappim
schappim / just_f-ing_ping.md
Last active December 26, 2025 00:20
Just F-ing Ping - Because sometimes you just want to f-ing ping!

Just F-ing Ping

Because sometimes you just want to f-ing ping!

Modern browsers, believing they are being clever, hide the protocol in the URL bar.

image

However, even if you only select the hostname, when you paste that URL into your terminal, you will encounter the following:

image

@Chubek
Chubek / POSIX-Shell.ebnf
Last active March 25, 2026 10:37
The POSIX Shell Grammar
# Lexical and Syntactic EBNF Grammar for POSIX Shell (Non-Attributed)
# Authored by Chubak Bidpaa (chubakbidpaa@riseup.net)
# Written For the Marsh Shell (https://github.com/Chubek/Marsh)
# This grammar is based on POSIX specs (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html)
# This document is released under `Unlicense` Public Domain License Agreement | (C) 2024 Chubak Bidpaa | No Warranty
# A: Lexical Grammar for POSIX Shell
@timothyham
timothyham / ipv6guide.md
Last active March 31, 2026 18:27
A Short IPv6 Guide for Home IPv4 Admins

A Short IPv6 Guide for Home IPv4 Admins

This guide is for homelab admins who understand IPv4s well but find setting up IPv6 hard or annoying because things work differently. In some ways, managing an IPv6 network can be simpler than IPv4, one just needs to learn some new concepts and discard some old ones.

Let’s begin.

First of all, there are some concepts that one must unlearn from ipv4:

Concept 1