Skip to content

Instantly share code, notes, and snippets.

View AntonLydike's full-sized avatar
🪄
We're doing this not because it's easy, but because we *thoght* it was

Anton Lydike AntonLydike

🪄
We're doing this not because it's easy, but because we *thoght* it was
View GitHub Profile
@AntonLydike
AntonLydike / non-terminating-html.md
Last active April 15, 2021 11:44
Non-terminating HTML Document

Creating valid HTML documents that can never be parsed

While watching Andreas Klings video on building an HTML parser, I noticed, that a piece of HTML can be constructed, which will never terminate when parsed.

The document.write() keyword:

When parsing an HTML document, scripts have to be executed and their document.write() output has to be parsed as well. This allows us, js to insert html into a document at parse-time, such as ... Hello <script>document.write(localStorage.getItem('username'))</script> ... to print

@AntonLydike
AntonLydike / risc-v.tex
Last active August 30, 2024 22:37
RISC-V Assembler lstlisting syntax and style
% RISC-V Assembler syntax and style for latex lstlisting package
%
% These are risc-v commands as per our university (University Augsburg, Germany) guidelines.
%
% Author: Anton Lydike
%
% This code is in the public domain and free of licensing
% language definition
\lstdefinelanguage[RISC-V]{Assembler}
@AntonLydike
AntonLydike / table.pdf
Last active June 5, 2019 12:22
Intricate latex table
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AntonLydike
AntonLydike / Logger.js
Last active November 29, 2016 23:20
Simple, configurable project logger
((loggers = {}) => {
if (loggers && loggers.__allow === undefined) loggers.__allow = "warn error";
if (loggers && loggers.__supress === undefined) loggers.__supress = "";
let disabled = false,
log = (token, method, ...a) => {
if (!disabled && loggers !== false && (loggers.__supress.indexOf(method) == -1) && ((loggers.__allow.indexOf(method) > -1) || loggers[token] !== false)) console[method].apply(console, a)
};