<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: hacks</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/hacks.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2024-04-21T13:59:06+00:00</updated><author><name>Simon Willison</name></author><entry><title>doom-htop</title><link href="https://simonwillison.net/2024/Apr/21/doom-htop/#atom-tag" rel="alternate"/><published>2024-04-21T13:59:06+00:00</published><updated>2024-04-21T13:59:06+00:00</updated><id>https://simonwillison.net/2024/Apr/21/doom-htop/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/0x0mer/doom-htop"&gt;doom-htop&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Ludicrous, brilliant hack: it runs Doom, converts each frame to ASCII art, then runs one process for each line of ASCII and sets each process to allocate enough memory such that sorting by M_VIRT will show the lines in the correct order. Then it updates the argv[0] for each process on every frame such that htop displays the state of the game.&lt;/p&gt;

&lt;p&gt;Probably only works on Ubuntu.&lt;/p&gt;

&lt;p&gt;From the FAQ: “Q: Why did you make this? A: I thought it would be funny.”

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/willmcgugan/status/1782022301925400682"&gt;@willmcgugan&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/hacks"&gt;hacks&lt;/a&gt;&lt;/p&gt;



</summary><category term="hacks"/></entry><entry><title>Trainbot</title><link href="https://simonwillison.net/2023/Apr/28/trainbot/#atom-tag" rel="alternate"/><published>2023-04-28T14:24:29+00:00</published><updated>2023-04-28T14:24:29+00:00</updated><id>https://simonwillison.net/2023/Apr/28/trainbot/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/jo-m/trainbot"&gt;Trainbot&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
“Trainbot watches a piece of train track, detects passing trains, and stitches together images of them”—check out the site itself too, which shows beautifully stitched panoramas of trains that have recently passed near Jo M’s apartment. Found via the best Hacker News thread I’ve seen in years, “Ask HN: Most interesting tech you built for just yourself?”.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=35729232"&gt;Ask HN: Most interesting tech you built for just yourself?&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/computer-vision"&gt;computer-vision&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/go"&gt;go&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hacks"&gt;hacks&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/raspberry-pi"&gt;raspberry-pi&lt;/a&gt;&lt;/p&gt;



</summary><category term="computer-vision"/><category term="go"/><category term="hacks"/><category term="raspberry-pi"/></entry><entry><title>The Commodordion</title><link href="https://simonwillison.net/2022/Oct/21/the-commodordion/#atom-tag" rel="alternate"/><published>2022-10-21T23:36:10+00:00</published><updated>2022-10-21T23:36:10+00:00</updated><id>https://simonwillison.net/2022/Oct/21/the-commodordion/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://linusakesson.net/commodordion/index.php"&gt;The Commodordion&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
The Commodordion is “an 8-bit accordion primarily made of C64s, floppy disks, and gaffer tape” by Linus Åkesson. It’s absolutely beautiful.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=33290863"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/commodore"&gt;commodore&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hacks"&gt;hacks&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/music"&gt;music&lt;/a&gt;&lt;/p&gt;



</summary><category term="commodore"/><category term="hacks"/><category term="music"/></entry><entry><title>gls: Goroutine local storage</title><link href="https://simonwillison.net/2019/May/28/gls-goroutine-local-storage/#atom-tag" rel="alternate"/><published>2019-05-28T23:13:38+00:00</published><updated>2019-05-28T23:13:38+00:00</updated><id>https://simonwillison.net/2019/May/28/gls-goroutine-local-storage/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/jtolds/gls"&gt;gls: Goroutine local storage&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Go doesn't provide a mechanism for having "goroutine local" variables (like threadlocals in Python but for goroutines), and the structure of the language makes it really hard to get something working. JT Olio figured out a truly legendary hack: Go's introspection lets you see the current stack, so he figured out a way to encode a base-16 identifer tag into the call order of 16 special nested functions.&lt;/p&gt;
&lt;p&gt;I particularly like the "What are people saying?" section of the README:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"Wow, that's horrifying."&lt;/p&gt;
&lt;p&gt;"This is the most terrible thing I have seen in a very long time."&lt;/p&gt;
&lt;p&gt;"Where is it getting a context from? Is this serializing all the requests? What the heck is the client being bound to? What are these tags? Why does he need callers? Oh god no. No no no."&lt;/p&gt;
&lt;/blockquote&gt;

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/aboodman/status/1133507328458649600"&gt;Aaron Boodman&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/go"&gt;go&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hacks"&gt;hacks&lt;/a&gt;&lt;/p&gt;



</summary><category term="go"/><category term="hacks"/></entry><entry><title>10K Apart Contest: Cheating by Compressing Your JavaScript and CSS to PNG Images</title><link href="https://simonwillison.net/2010/Aug/23/alex/#atom-tag" rel="alternate"/><published>2010-08-23T09:45:00+00:00</published><updated>2010-08-23T09:45:00+00:00</updated><id>https://simonwillison.net/2010/Aug/23/alex/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://alexle.net/archives/306"&gt;10K Apart Contest: Cheating by Compressing Your JavaScript and CSS to PNG Images&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Fascinating hack: transform your JS and CSS in to coloured pixels, save the result as a PNG to benefit from PNG’s built in compression algorithms, then read the data back out of the PNG and convert it back to text using JavaScript and canvas—all to reduce the on-disk filesize when entering the 10K app competition. Alex’s GithubFinder entry is worth checking out too.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/compression"&gt;compression&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/github"&gt;github&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hacks"&gt;hacks&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/javascript"&gt;javascript&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/png"&gt;png&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/recovered"&gt;recovered&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/10kapart"&gt;10kapart&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/alex-le"&gt;alex-le&lt;/a&gt;&lt;/p&gt;



</summary><category term="compression"/><category term="github"/><category term="hacks"/><category term="javascript"/><category term="png"/><category term="recovered"/><category term="10kapart"/><category term="alex-le"/></entry><entry><title>Quoting qwzybug on Hacker News</title><link href="https://simonwillison.net/2010/Aug/10/hack/#atom-tag" rel="alternate"/><published>2010-08-10T11:54:00+00:00</published><updated>2010-08-10T11:54:00+00:00</updated><id>https://simonwillison.net/2010/Aug/10/hack/#atom-tag</id><summary type="html">
    &lt;blockquote cite="http://news.ycombinator.com/item?id=1590621"&gt;&lt;p&gt;When all of human endeavor falls under the rubric of the “hack” the word ceases to mean anything. Hack your commute, take public transit! Hack your next dinner party with parlour games. Delightfully clever key hack keeps all your keys on the same ring. Hack Mexican food with a “burrito” sized tortilla! Hack your brain with REM sleep. Hack the sun with a straw hat. Hack hygiene with silver oxide “deodorant”. Hack girls with compliments. Hack your windowsill with a pot of wheatgrass, and hack the sky with the goddamn moon.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="http://news.ycombinator.com/item?id=1590621"&gt;qwzybug on Hacker News&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/funny"&gt;funny&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hacker-news"&gt;hacker-news&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hacks"&gt;hacks&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/recovered"&gt;recovered&lt;/a&gt;&lt;/p&gt;



</summary><category term="funny"/><category term="hacker-news"/><category term="hacks"/><category term="recovered"/></entry><entry><title>Video for Everybody!</title><link href="https://simonwillison.net/2009/Jul/2/camen/#atom-tag" rel="alternate"/><published>2009-07-02T19:33:02+00:00</published><updated>2009-07-02T19:33:02+00:00</updated><id>https://simonwillison.net/2009/Jul/2/camen/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://camendesign.com/code/video_for_everybody#video-code"&gt;Video for Everybody!&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Reminiscent of the early days of Web Standards, Kroc Camen has created a fiendishly clever chunk of HTML which can play a video on any browser, starting with HTML5 video then falling back on Flash and eventually just an HTML message telling the user where they can download the file. No JavaScript to be seen, but conditional comments abound. Requires you to encode as both Ogg and H.264, but Kroc includes details instructions for doing that using Handbrake.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/codecs"&gt;codecs&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/encoding"&gt;encoding&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/h264"&gt;h264&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hacks"&gt;hacks&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/handbrake"&gt;handbrake&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/html"&gt;html&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/html5"&gt;html5&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/kroccamen"&gt;kroccamen&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ogg"&gt;ogg&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/video"&gt;video&lt;/a&gt;&lt;/p&gt;



</summary><category term="codecs"/><category term="encoding"/><category term="h264"/><category term="hacks"/><category term="handbrake"/><category term="html"/><category term="html5"/><category term="kroccamen"/><category term="ogg"/><category term="video"/></entry><entry><title>Notes from Hack Day at The Guardian</title><link href="https://simonwillison.net/2008/Nov/18/hackday/#atom-tag" rel="alternate"/><published>2008-11-18T23:42:46+00:00</published><updated>2008-11-18T23:42:46+00:00</updated><id>https://simonwillison.net/2008/Nov/18/hackday/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.mattmcalister.com/blog/2008/11/18/256/notes-from-hack-day-at-the-guardian/"&gt;Notes from Hack Day at The Guardian&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Our first hack day was a ridiculous amount of fun. Matt’s write-up includes a 15 minute highlight video, which includes my 90 second presentation of my crowdsourcing SVG-powered parliamentary constituencies hack.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/hackday"&gt;hackday&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hacks"&gt;hacks&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/matt-mcalister"&gt;matt-mcalister&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/svg"&gt;svg&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/the-guardian"&gt;the-guardian&lt;/a&gt;&lt;/p&gt;



</summary><category term="hackday"/><category term="hacks"/><category term="matt-mcalister"/><category term="svg"/><category term="the-guardian"/></entry><entry><title>Quoting Anil Dash</title><link href="https://simonwillison.net/2008/Jun/26/anil/#atom-tag" rel="alternate"/><published>2008-06-26T17:17:30+00:00</published><updated>2008-06-26T17:17:30+00:00</updated><id>https://simonwillison.net/2008/Jun/26/anil/#atom-tag</id><summary type="html">
    &lt;blockquote cite="http://www.dashes.com/anil/2008/06/bill-gates-and-the-greatest-tech-hack-ever.html"&gt;&lt;p&gt;Bill Gates has pulled off one of the greatest hacks in technology and business history, by turning Microsoft's success into a force for social responsibility. Imagine imposing a tax on every corporation in the developed world, collecting $100 per white-collar worker per year, and then directing one third of the proceeds to curing AIDS and malaria.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="http://www.dashes.com/anil/2008/06/bill-gates-and-the-greatest-tech-hack-ever.html"&gt;Anil Dash&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/aids"&gt;aids&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/anil-dash"&gt;anil-dash&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/bill-gates"&gt;bill-gates&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hacks"&gt;hacks&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/malaria"&gt;malaria&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/microsoft"&gt;microsoft&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/philanthropy"&gt;philanthropy&lt;/a&gt;&lt;/p&gt;



</summary><category term="aids"/><category term="anil-dash"/><category term="bill-gates"/><category term="hacks"/><category term="malaria"/><category term="microsoft"/><category term="philanthropy"/></entry><entry><title>Bit Twiddling Hacks</title><link href="https://simonwillison.net/2007/Nov/2/bits/#atom-tag" rel="alternate"/><published>2007-11-02T06:49:34+00:00</published><updated>2007-11-02T06:49:34+00:00</updated><id>https://simonwillison.net/2007/Nov/2/bits/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://graphics.stanford.edu/~seander/bithacks.html"&gt;Bit Twiddling Hacks&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
I’ve never been much of a bit twiddler, but I’ve always felt I should learn.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/binary"&gt;binary&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/bits"&gt;bits&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/bittwiddling"&gt;bittwiddling&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hacks"&gt;hacks&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/programming"&gt;programming&lt;/a&gt;&lt;/p&gt;



</summary><category term="binary"/><category term="bits"/><category term="bittwiddling"/><category term="hacks"/><category term="programming"/></entry></feed>