I made a parser for a CSS dialect (with far less features) to style my C++ game UI (which is made with Clay).
Why? Well, plenty of reasons why not, so I'll just say:
| // Can be used with https://github.com/xcv58/Custom-JavaScript-for-Websites-2 | |
| // This snippet is released under the terms of the CC0 license: https://creativecommons.org/publicdomain/zero/1.0/deed.en | |
| const cache_key = 'hn_comments_views' | |
| const cache = JSON.parse(localStorage.getItem(cache_key) || '{}') | |
| document.querySelectorAll('.athing.comtr').forEach(comm => { | |
| if (!cache[comm.id]) { | |
| const span = document.createElement('span') | |
| span.innerHTML = '🔔' // :bell: emoji |
I made a parser for a CSS dialect (with far less features) to style my C++ game UI (which is made with Clay).
Why? Well, plenty of reasons why not, so I'll just say:
| [package] | |
| name = "hurl-demo-stresstest-backend" | |
| version = "0.1.0" | |
| edition = "2024" | |
| [dependencies] | |
| anyhow = "1" | |
| tokio = { version = "1", features = ["full"] } | |
| hyper = { version = "1", features = ["full"] } | |
| hyper-util = { version = "0.1", features = ["full"] } |
| { | |
| "openapi": "3.0.3", | |
| "info": { | |
| "title": "NetBox REST API", | |
| "version": "3.6.9 (3.6)", | |
| "license": { | |
| "name": "Apache v2 License" | |
| } | |
| }, | |
| "paths": { |
When setting up a Python/Django project, I like to do a few things:
| #pragma once | |
| #include <algorithm> | |
| #include <array> | |
| #include <random> | |
| #include <glm/vec3.hpp> | |
| #include <hex/coords.hpp> |
| #pragma once | |
| #include <type_traits> | |
| #include <concepts> | |
| #include <functional> | |
| #include <stdexcept> | |
| #include <optional> | |
| #include <vector> | |
| #include <tuple> |
| #!/bin/sh | |
| cat <<EOF | docker run --rm -i alpine:latest sh | |
| apk add --no-cache iproute2 >/dev/null | |
| ip -4 route show default | cut -d' ' -f3 | |
| EOF |
| #!/bin/bash | |
| if [ "$UID" != "0" ] | |
| then | |
| echo "You have to be root" >&2 | |
| exit 1 | |
| fi | |
| CHROOT=$1 |
| let task_args: Vec<Value> = vec![]; | |
| let mut block = func.call(&mut context, task_args); | |
| let ignored = Value::Boolean(bool::default()); | |
| let mut state = block.resume_with(ignored); | |
| loop { | |
| match &state { | |
| GeneratorState::Yielded(FunctionInterruption::Effect { name, args }) => { | |
| // try to handle side effect |