Filter
Exclude
Time range
-
Near
Replying to @lcamtuf
wat, gcc is now supporting unicode in the preprocessor??? I hate you.
2
19
2,182
Hey Grok, where did the hashtag originate and how is used now? [GROK] The hashtag (#) has two main layers to its history: the symbol's ancient origins and its modern use as a tagging tool on social media. britannica.com The # symbol, also known as the hash, pound sign, number sign, or octothorpe, traces back to ancient Rome. It evolved from the abbreviation "lb" for libra pondo ("pound in weight"), a unit of mass. To distinguish the "l" from the number "1" and indicate it was an abbreviation, scribes added horizontal lines through the letters. Over centuries of handwritten use (with examples from Isaac Newton's time in the late 17th century), this ligature simplified into the crossed lines we recognize today as #. britannica.com By the 1870s, it appeared on QWERTY typewriter keyboards, often denoting "number" (e.g., #2 pencil). In 1968, Bell Labs added it (along with the asterisk) to touch-tone phone keypads for computer commands, helping popularize it in electronics. britannica.com It had other pre-social media uses in computing, such as in programming languages (e.g., C preprocessor directives in the 1970s) and early systems like PDP-11 assembly. web.archive.org The Hashtag as a Social Media ToolThe modern hashtag—using # to tag and group topics—emerged in the early internet and exploded on Twitter (now X). It was inspired by Internet Relay Chat (IRC) in the late 1980s/1990s, where # prefixed channel names (e.g., #linux) to organize discussions. web.archive.org On August 23, 2007, American product designer and blogger Chris Messina proposed it on Twitter with this tweet: "How do you feel about using # (pound) for groups. As in #barcamp [msg]?" He suggested it to help users easily find and join conversations without needing advanced search skills. Twitter initially dismissed it as "a thing for nerds," but Messina didn't patent it, believing it belonged to the internet. web.archive.org The idea gained traction organically. It spread widely during the 2007 San Diego wildfires, when people used tags like #sandiegofire to share updates. Stowe Boyd coined the term "hash tags" shortly after in a blog post. web.archive.org Today, hashtags are a core feature across platforms like Instagram, Facebook, and others for categorization, activism, marketing, and trends. Messina is often called the "godfather of the hashtag." britannica.com In short, the symbol is centuries old, but its role as a clickable, searchable tag is a 21st-century innovation born from internet chat culture.
32
Mohamed Aly retweeted
In June 2009, Alexis Sellier designed a CSS preprocessor called Less 1.0, a dynamic styling language for cascading styles. The Less language was influenced by the existing Sass preprocessor. #WebDesignHistory
2
5
104
29,074
I've moved all my local Obsidian content to the web on @cloudflare Workers, using the GitHub API, @tan_stack start, and Fumadocs Here's a rant about the problems I've faced: > tried fumadocs-ui with TanStack Start, DocsLayout expects Next.js router context, had to use undocumented fumadocs-ui/provider/tanstack wrapper > used import.meta.glob for vault .md files, Vite refuses to resolve symlinks, set preserveSymlinks AND server.fs.allow for parent dir > remark-math parses Full Loss: $$ as inline math start, $$Classification Loss: as closing delimiter, entire document between = one KaTeX block = red error cascade > wrote preprocessor to split $$ onto own lines, now indented list items break because $$ with 4 spaces = code block not math fence per CommonMark > closing $$ at 4-space indent doesn't close math block in micromark, requires ≤3 spaces, everything after becomes red KaTeX error > rehype-katex omits throwOnError from Options type via Omit<>, can't disable red error rendering, only strict: 'ignore' available > KaTeX chokes on unicode inside accidental math blocks: zero-width spaces (8203), smart quotes (8217), emojis ✅❌ all throw "No character metrics" warnings > renderMarkdown runs twice (SSR hydration), both execute full remark rehype KaTeX pipeline, client re-parses already-rendered HTML causing duplicate warnings > switched to pre-rendering KaTeX before remark, used <span> wrapper, remark parses span contents as markdown, closes at first inner </span> not outer > KaTeX outputs MathML <annotation> with raw LaTeX source, remark leaks annotation text into output showing {DETR} = \lambda{cls} as plain text > set output: 'html' to strip MathML, switched to <div> wrapper, remark treats as opaque HTML block — now <div> at column 0 breaks nested list context > deeply indented list items after <div> become code blocks, 4-tab indent (16 spaces) no longer recognized as list continuation after block element > tried <span style="display:block"> to keep inline context, KaTeX's nested spans still get fragmented by remark's inline HTML parser > tried custom <math-display> element with rehype plugin to replace post-parse, custom elements aren't in CommonMark type-6 block list but still break lists > TanStack Start splat routes need params._splat, not documented, found by reading api.trpc.$.tsx scaffold code > fumadocs-core PageTree.Item url field doesn't auto-encode spaces, manual `encodeURIComponent` needed for "Knowledge Index" → " " paths > wikilink resolution: Obsidian uses filename lookup not path, built filename→key index, then realized anchors need separate slugify matching heading ID generation > `[[Page#Section|Alias]]` wikilinks stripped to plain text initially, then added resolver but cross-vault links need vault context not available in renderer > Shiki highlighting in Workers: had to use JS regex engine not WASM, async codeToHtml inside sync processSync = Promise wrapper hell, moved to loader > `#Q question #A answer` flashcard syntax: regex eats newlines between tokens, had to use `[^\S\n] ` (horizontal whitespace only) to preserve structure > same-line `#Q text #A text` works, multi-line breaks, had to split first then group consecutive `#Q`/`#A` lines into `<div class="obsidian-qa">` blocks > hydration mismatch: fumadocs-ui RootProvider sets `className="dark"` on server, client detects different theme, added `suppressHydrationWarning` to `<html>` and `<body>` > Grammarly extension injects `data-gr-ext-installed` on body during hydration, triggers mismatch warnings, same `suppressHydrationWarning` fix > `flattenTree` from fumadocs-core expects `Node[]` not `PageTree.Root`, had to pass `tree.children` not `tree` > Obsidian image embeds image.png need conversion to standard markdown, built imageByFilename Map with both encoded and decoded keys for lookup > mermaid code blocks need client-side rendering, marked with .vault-mermaid class, lazy-loaded mermaid.js in useEffect after HTML set > scroll-to-anchor breaks on SPA navigation, hash exists before element rendered, added retry loop with 5 attempts × 100ms delay > anchor click handling: href="#section" needs preventDefault smooth scroll history.pushState, same-page vs cross-page detection via pathname comparison > Obsidian callouts > !note not standard markdown, need custom remark plugin or regex preprocessing, skipped for now > nested lists with mixed tabs/spaces: Obsidian uses 4-space equiv tabs, CommonMark interprets 4 spaces as code block in certain contexts > math inside list items: $$` must be ≤3 spaces from list item content column, Obsidian allows 0-indent which breaks list continuation > `processSync` can't handle async Shiki highlighting, had to make renderMarkdown async, moved call to route loader for SSR > KaTeX CSS `?url` import generates hashed asset path, works in dev but needed verification for Worker ASSETS binding in prod > search API uses `createSearchAPI("advanced")` with structuredData, had to strip markdown syntax for indexable text, regex soup for fenced blocks/links/math > slugifyAnchor normalization: Obsidian "IOU (Heading)" and "IOU(Heading)" both need same slug, added `\s \(` → `(` replacement before kebab-case > blank lines inside `$$ math blocks: Obsidian allows, standard CommonMark terminates block, wrote pass to normalize delimiter placement > \` at end of lines in LaTeX cases environment: \ (backslash space) vs \\ (line break), inconsistent source files cause KaTeX errors > styling broken via proxy: assets at `/fumadocs/assets/*` correctly proxied but Worker can't find files because path mismatch with actual build output location > pnpm v10 `ERR_PNPM_IGNORED_BUILDS` hard error: esbuild/sharp/workerd scripts blocked, moved `onlyBuiltDependencies` from `package.json#pnpm` to `pnpm-workspace.yaml` > fumadocs-ui `.shiki:not(.not-fumadocs-codeblock *)` CSS matches ALL `.shiki` elements, applies padding/position to `.line` spans creating horizontal separator lines between code rows > Shiki `bundledThemes` not obvious, had to enumerate keys to find available dark themes > code span colors overridden: fumadocs-ui `code span { color: var(--shiki-light) }` rule wipes all inline token colors from Shiki output > RootProvider `search` prop API undocumented for TanStack, dug through `.d.ts` files to find `DefaultSearchDialogProps` interface > DocsLayout `tree` prop needs `PageTree.Root`, had to read bundled `definitions-Cob-Q8-8.d.ts` to understand Item/Folder/Separator structure > fumadocs-core loader accepts `VirtualFile` objects, could construct manually but easier to build PageTree directly from file paths > `createMarkdownRenderer` from fumadocs-core uses remark rehype internally, but outputs React component not HTML string, needed different approach > gray-matter and marked not needed: fumadocs-core has `content/md/frontmatter` and remark pipeline built-in, but as transitive deps not directly importable in pnpm > `fumadocs-core/mdx-plugins/remark-gfm` re-exports remarkGfm, can use without adding direct dependency > Cloudflare Worker can't use filesystem at runtime, all content must be bundled at build time via import.meta.glob eager loading > glob pattern `'../../content/**/*.md'` from src/lib needed symlink in place AND Vite fs.allow config for parent directory > `$vault.tsx` acts as layout needing `<Outlet />`, `$vault.index.tsx` is vault index, `$vault.$.tsx` is catch-all, file naming convention undocumented > TanStack Router basepath `/fumadocs` handles routing but Vite base affects asset URLs differently, needed both configured correctly > mermaid.initialize() must be called before mermaid.run(), but DOM not ready on hydration, race condition with useEffect timing > structuredData from search index includes raw markdown, needed regex to strip fenced blocks, wikilinks, math delimiters for clean search text

2
1
7
607
i mean, all i really need in a css preprocessor is variables and mixins..
2
2,293
Replying to @adityasysarch @if
(Part 3/3) How do you actually ship this safely to production today while browser support continues to roll out across engines? You use a clean, progressive enhancement workflow paired with native feature detection:- The Composite Pattern:- You can wrap themes, accent colors, and remote feature flags (--flag-new) into a single component block for absolute maintainability without redeploying code. Feature Detection Overrides:- Write your solid baseline CSS rules first. Then, layer your advanced inline logic safely inside an @supports (background: if(style(), a, b)) block so non-supporting engines don't break. Toolchain Elimination:- This cleanly replaces complex preprocessor build architectures, duplicate selector overrides, and fragile client-side hydration scripts. Review the final slides for the production pattern recipe and the complete if() syntax reference cheat sheet. Make sure to bookmark the top of this thread for your next design system refactor. 🏛️
1
14
Replying to @adityasysarch @if
(Part 2/3) Once you understand the basic ternary syntax, you can scale it into global design tokens that control entire layout architectures with a single property toggle. By passing custom properties as global switches and nesting your if() branches, you completely eliminate BEM modifier hell and complex preprocessor mixin files:- Global Switch Control:- Toggling a single variable like --density: 'compact' at the :root level propagates sizing modifications system-wide zero component overrides required. Nested Logic Branching:- You can nest subsequent if() statements inside the fallback parameter to create multi-variant component rules (e.g., matching .button variants like primary, secondary, and danger in a single style line). Native Mixin Architecture:- Define your color logic pairs once, map them to component variants, and achieve zero-duplication code safety. Check the attached slides for the multi-variant nesting recipes. The final part below details a real-world production pattern, progressive enhancement fallbacks, and the full cheat sheet. 👇
1
1
33
We are officially entering the era of zero-preprocessor, zero-runtime-JS styling logic. Native inline conditional rules - via the new if() function wrapper - are landing directly in the browser. You no longer need Sass @if compile steps or messy JavaScript class toggles just to switch a UI theme or handle basic state changes. The core shift under the hood: The Inline Ternary:- The syntax follows a strict if(condition, true_value, fallback_value) structure. Render-Time Evaluation:- Instead of compiling static utilities into a stylesheet ahead of time, the browser evaluates the conditions dynamically at render time. Zero Class Toggling:- A single rule block natively handles both dark and light modes simultaneously based purely on custom token evaluation. Check the first three slides to see the foundational syntax breakdown. Part 2 is dropping right below to look at nesting complex component variants and setting up system-wide design tokens. 👇
1
1
30
yup. fewer preprocessor macros, compile-time lambdas, overloading, implicit conversions, etc
9
Jun 11
Replying to @zuhaitz_dev
Mfw the preprocessor macros generate >2 billion lines of code
2
49
Replying to @Joshkoolk
PHP Hypertext Preprocessor
4
493
Valentino Slavkin retweeted
You know a C library is surely professional when a considerable chunk of the lines are preprocessor conditionals.
glibc is incredible learning material. It aims to handle all and every possible use case, CPU, and architecture under the sun. First pic is part of its memcmp implementation for CPUs with AVX2. But it's so densely written it's hostile to uninitiated reader. I think glibc is an example of DRY that went too far. I much more prefer repetition approach from musl. E.g. instead of ifdefs embedded into a struct or algorithm, it tends to ifdef the struct itself. This results in more lines of code, but it's so much easier to understand when you want to follow a specific branch. Of course, sometimes glibc does outside ifdefs, and sometimes musl does embedded ifdefs. I'm talking about ratios. I'm now getting used to GNU coding style and now it's a bit easier for me to read glibc, but it could be written so much more approachable.
6
6
162
10,644
Jun 10
Replying to @esrtweet
I am interested to implement parts or the whole logic of the C preprocessor. Could you recommend any projects that I could steal ideas or even link to their implementation. GCC is in C and is very ugly. Ideally it should be implemented in C Thanks in advance.
16
Every C developer has a cursed shell script somewhere that converts a binary file into a C array so it can be compiled in bin2c. xxd. Platform specific linker hacks. Custom CMake incantations C 26 just killed all of them. One preprocessor directive
1
7
197
Replying to @FelixCLC_
all caps is for preprocessor shenanigans so looking gross is the point I guess
1
20