frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
415•klaussilveira•5h ago•94 comments

The Waymo World Model

https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simula...
769•xnx•11h ago•465 comments

Why I Joined OpenAI

https://www.brendangregg.com/blog/2026-02-07/why-i-joined-openai.html
35•SerCe•1h ago•31 comments

Show HN: Look Ma, No Linux: Shell, App Installer, Vi, Cc on ESP32-S3 / BreezyBox

https://github.com/valdanylchuk/breezydemo
137•isitcontent•5h ago•15 comments

Monty: A minimal, secure Python interpreter written in Rust for use by AI

https://github.com/pydantic/monty
129•dmpetrov•6h ago•54 comments

Dark Alley Mathematics

https://blog.szczepan.org/blog/three-points/
37•quibono•4d ago•2 comments

Show HN: I spent 4 years building a UI design tool with only the features I use

https://vecti.com
240•vecti•7h ago•116 comments

A century of hair samples proves leaded gas ban worked

https://arstechnica.com/science/2026/02/a-century-of-hair-samples-proves-leaded-gas-ban-worked/
61•jnord•3d ago•4 comments

Microsoft open-sources LiteBox, a security-focused library OS

https://github.com/microsoft/litebox
308•aktau•12h ago•153 comments

Sheldon Brown's Bicycle Technical Info

https://www.sheldonbrown.com/
309•ostacke•11h ago•84 comments

Show HN: If you lose your memory, how to regain access to your computer?

https://eljojo.github.io/rememory/
168•eljojo•8h ago•124 comments

Hackers (1995) Animated Experience

https://hackers-1995.vercel.app/
386•todsacerdoti•13h ago•217 comments

An Update on Heroku

https://www.heroku.com/blog/an-update-on-heroku/
313•lstoll•12h ago•230 comments

Show HN: R3forth, a ColorForth-inspired language with a tiny VM

https://github.com/phreda4/r3
48•phreda4•5h ago•8 comments

I spent 5 years in DevOps – Solutions engineering gave me what I was missing

https://infisical.com/blog/devops-to-solutions-engineering
106•vmatsiiako•10h ago•34 comments

How to effectively write quality code with AI

https://heidenstedt.org/posts/2026/how-to-effectively-write-quality-code-with-ai/
179•i5heu•8h ago•128 comments

Introducing the Developer Knowledge API and MCP Server

https://developers.googleblog.com/introducing-the-developer-knowledge-api-and-mcp-server/
13•gfortaine•3h ago•0 comments

Understanding Neural Network, Visually

https://visualrambling.space/neural-network/
231•surprisetalk•3d ago•30 comments

I now assume that all ads on Apple news are scams

https://kirkville.com/i-now-assume-that-all-ads-on-apple-news-are-scams/
969•cdrnsf•15h ago•414 comments

PC Floppy Copy Protection: Vault Prolok

https://martypc.blogspot.com/2024/09/pc-floppy-copy-protection-vault-prolok.html
8•kmm•4d ago•0 comments

Learning from context is harder than we thought

https://hy.tencent.com/research/100025?langVersion=en
140•limoce•3d ago•79 comments

FORTH? Really!?

https://rescrv.net/w/2026/02/06/associative
39•rescrv•13h ago•17 comments

Evaluating and mitigating the growing risk of LLM-discovered 0-days

https://red.anthropic.com/2026/zero-days/
34•lebovic•1d ago•11 comments

Show HN: Smooth CLI – Token-efficient browser for AI agents

https://docs.smooth.sh/cli/overview
76•antves•1d ago•57 comments

I'm going to cure my girlfriend's brain tumor

https://andrewjrod.substack.com/p/im-going-to-cure-my-girlfriends-brain
37•ray__•2h ago•11 comments

The Oklahoma Architect Who Turned Kitsch into Art

https://www.bloomberg.com/news/features/2026-01-31/oklahoma-architect-bruce-goff-s-wild-home-desi...
17•MarlonPro•3d ago•4 comments

Show HN: Slack CLI for Agents

https://github.com/stablyai/agent-slack
38•nwparker•1d ago•8 comments

Claude Composer

https://www.josh.ing/blog/claude-composer
101•coloneltcb•2d ago•69 comments

How virtual textures work

https://www.shlom.dev/articles/how-virtual-textures-really-work/
25•betamark•12h ago•23 comments

The Beauty of Slag

https://mag.uchicago.edu/science-medicine/beauty-slag
31•sohkamyung•3d ago•3 comments
Open in hackernews

Fizz Buzz in CSS

https://susam.net/fizz-buzz-in-css.html
110•froober•2mo ago

Comments

kevinsync•2mo ago
I love this, it's a very clever and funny way to solve the problem. Makes me think about how there are infinite routes from A to B, some more scenic and whimsical than others.. as well as all the people I've met along the way who would be so pissed and pedantic about how this isn't a "real solution" LOL
hyperhello•2mo ago
The problem is that you have to define the problem enough to avoid the fact that it's trivial to output the string "1,2,Fizz,4,Buzz,......" and fulfill the assignment. You can, in fact, output "$1,$2,Fizz,$4,Buzz,..." where $ is any prefix itself divisible by 15 (there are other templates for the other situations but it clearly does repeat endlessly.)
susam•2mo ago
A shorter solution is possible with an ordered list (<ol>) if we're willing to ignore the untidy output:

  li:nth-child(3n), li:nth-child(5n) { list-style: none }
  li:nth-child(3n)::before { content: "Fizz" }
  li:nth-child(5n)::after { content: "Buzz" }
Example: https://susam.net/code/web/css-fizz-buzz-ol.html

  $ curl -sS https://susam.net/code/web/css-fizz-buzz-ol.html | sed -n '/none/,/after/p' |  tr -d '[:space:]' 
  li:nth-child(3n),li:nth-child(5n){list-style:none}li:nth-child(3n)::before{content:"Fizz"}li:nth-child(5n)::after{content:"Buzz"}
  $ curl -sS https://susam.net/code/web/css-fizz-buzz-ol.html | sed -n '/none/,/after/p' |  tr -d '[:space:]' | wc -c
  129
But I don't quite like how misaligned the numbers and the words look in this version. Correcting that would call for extra code that would cancel out the characters saved.
cluckindan•2mo ago

    list-style-position: inside;
susam•2mo ago
Yes! However, like I mentioned in my previous comment, corrections like this cancel out the number of bytes saved with the <ol>-based solution.

I mean, the solution in the original post is 152 characters long.

The <ol> based solution is 129 characters long. Shorter but uglier.

If we add your correction, we get neater output, which is nice, but it comes at the cost of 30 additional characters in the minified code thereby making the solution 159 characters long.

  li { list-style-position: inside }
  li:nth-child(3n), li:nth-child(5n) { list-style: none }
  li:nth-child(3n)::before { content: "Fizz" }
  li:nth-child(5n)::after { content: "Buzz" }
carl_dr•2mo ago
Ignoring the size of the HTML in addition to the CSS, it’s fun, but not really fair when talking about code golf. Beyond a few numbers, you need to include some JavaScript and generating a million list elements. But those bytes count …
graiz•2mo ago
145 using P instead of li.

<style> p{counter-increment:n} p:not(:nth-child(5n)):before{content:counter(n)} p:nth-child(3n):before{content:"Fizz"} p:nth-child(5n):after{content:"Buzz"} </style><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>

rebane2001•2mo ago
im not sure how you counted that as 145, but here's 137 for the css

<style>p{--n:counter(n);counter-increment:n;&:before{content:var(--n)};&:nth-child(5n){--n:"";&:after{content:"Buzz"}}&:nth-child(3n){--n:"Fizz"</style><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p><p>

dsmmcken•2mo ago
144, using css variables, with fallback and p instead of li

https://codepen.io/dsmmcken/pen/WbwYOEQ?editors=0100

p{counter-increment:n;--n:counter(n)}p:nth-child(3n){--f:"Fizz"}p:nth-child(5n){--b:"Buzz";--n:''}p::after{content:var(--f,var(--n))var(--b,'')}

genezeta•2mo ago
To nitpick a bit, I'd say there is something that is "placed outside the stylesheet".

Now, arguably it's not a "number or word that appears in the output", that's true, but it is a part of the logic of FizzBuzz. It's the fact that there are 100 and exactly 100 <li> elements in the HTML part.

I mean, it wouldn't be a correct FizzBuzz without precisely that HTML. Having exactly 100 <li> elements is implementing the part of the logic that a. loops, and b. stops at 100.

But of course this is just nitpicking, as I said ;)

culi•2mo ago
HTML is just the runtime of CSS
Metaboat•2mo ago
104 :nth-child(3n){list-style:"Fizz"}:nth-child(5n){list-style:"Buzz"}:nth-child(15n){list-style:"FizzBuzz"}

data:text/html,<style>:nth-child(3n){list-style:"Fizz"}:nth-child(5n){list-style:"Buzz"}:nth-child(15n){list-style:"FizzBuzz"}</style><ol id=o><script>o.innerHTML='<li>'.repeat(99)</script>

Metaboat•2mo ago
103 :nth-child(3n){list-style:"Fizz"}:nth-child(5n){list-style:"Buzz"}:nth-child(15n){list-style:"FizzBuzz"
Metaboat•2mo ago
98 :nth-child(5n){list-style:""}:nth-child(3n){list-style:"Fizz"}:nth-child(5n)::after{content:"Buzz"
Metaboat•2mo ago
95 :nth-child(5n){list-style:}:nth-child(3n){list-style:"Fizz"}:nth-child(5n)::after{content:"Buzz
Metaboat•2mo ago
68 :nth-child(3n){list-style:"Fizz"}:nth-child(5n)::after{content:"Buzz
eurleif•2mo ago
67 :nth-child(3n){list-style:"Fizz"}:nth-child(5n):after{content:"Buzz
Metaboat•2mo ago
thank you sir! i can improve the html op css was 152, we have the whole page at 144

data:text/html,<ol id=o><script>o.innerHTML='<li>'.repeat(100)</script><style>:nth-child(3n){list-style:"Fizz"}:nth-child(5n):after{content:"Buzz

throwaway150•2mo ago
Your code is showing the numbers 5, 10, 20. that's not correct, is it?

Yours prints 1. 2. Fizz 4. 5. Buzz Fizz 7.

But it should be 1. 2. Fizz 4. Buzz Fizz 7.

bulmenisaurus•2mo ago
This version fails for numbers like 5, showing "5. Buzz". In the case of a number divisible by 5 but not 3 nothing prevents the 5 in the ::marker from rendering.

Edit: it looks like your version can be fixed into a working 85:

  :nth-child(5n){list-style:'';&:after{content:"Buzz"}}:nth-child(3n){list-style:"Fizz"
cefqrn•2mo ago
89: :nth-child(3n)::marker{content:"Fizz"var(--b,)}:nth-child(5n){list-style:"Buzz";--b:"Buzz

with help from @bulmenisaurus

smrq•2mo ago
Am I the only one here who's never seen CSS counters before? Interesting feature, what are they useful for practically?