Skip to content

Instantly share code, notes, and snippets.

@bbuchalter
bbuchalter / case_test.rb
Last active May 25, 2022 11:31
Ruby can only parse 2498 case statement branches
case_statements = 10000
program = <<-RUBY
case(ARGV[1])
#{case_statements.times.map { |n| "when #{n+1} \n puts #{n+1}"}.join("\n")}
end
RUBY
File.write('test.rb', program)
puts "RUBY_VERSION=#{RUBY_VERSION}"
puts system('ruby test.rb')
@bbuchalter
bbuchalter / 2026-04-03-inline-comments-design.md
Last active April 4, 2026 00:32
HedgeDoc Inline Comments — Design Spec

HedgeDoc Inline Comments — Design Spec

Problem

HedgeDoc lacks a commenting feature. This is the most requested collaboration gap (issues #657, #2879, #5450) and a blocker for teams evaluating HedgeDoc as a Google Docs alternative. The community and maintainers have debated inline vs. out-of-band approaches for years without converging on a design.

Decision

Inline comments using CriticMarkup syntax, stored directly in the markdown document. A CodeMirror 6 extension hides the raw syntax and provides a clean UI. No backend changes required.

@bbuchalter
bbuchalter / gist:ee5e8c964c4e67eaf81d9ba670155e2a
Created April 6, 2026 02:31
Plan for hedgedoc#4943 - Robots Meta Tag Support
# Robots Meta Tag Support
**Issues:** [#4943](https://github.com/hedgedoc/hedgedoc/issues/4943), [#4951](https://github.com/hedgedoc/hedgedoc/issues/4951)
**Goal:** Allow admins to set a server-wide default `robots` meta tag (e.g., `noindex, nofollow`) and allow per-note override via frontmatter. Render the tag server-side so crawlers see it.
## Current State
- The `robots` frontmatter field is already parsed in `commons/src/note-frontmatter/` and defaults to `''`
- The parsed value is never persisted to the database, returned via API, or rendered as a meta tag