Ask HN: What's Your Proudest Hack?

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • htmx

    </> htmx - high power tools for HTML

  • my trick for making the `htmx:confirm` event act like it is blocking:

    https://github.com/bigskysoftware/htmx/blob/a3c414dcee94fd03...

    basically, redesign the arguments for a function such that I can call it again at a given spot with one parameter changed and, to a first order approximation, it acts as if the function is resumable.

    I've used this hack in many places now, just recently in idiomorph to allow head elements to load before the rest of the content is morphed:

    https://github.com/bigskysoftware/idiomorph/blob/e6dfc189fa3...

  • idiomorph

    A DOM-merging algorithm

  • my trick for making the `htmx:confirm` event act like it is blocking:

    https://github.com/bigskysoftware/htmx/blob/a3c414dcee94fd03...

    basically, redesign the arguments for a function such that I can call it again at a given spot with one parameter changed and, to a first order approximation, it acts as if the function is resumable.

    I've used this hack in many places now, just recently in idiomorph to allow head elements to load before the rest of the content is morphed:

    https://github.com/bigskysoftware/idiomorph/blob/e6dfc189fa3...

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • xdotool

    fake keyboard/mouse input, window management, and more

  • I often create screen recordings for my classes, but it's very boring and time consuming. I'm a perfectionist, and if I mistype a command I prefer to re-record everything. Moreover, every time one of the tools used in the videos gets a significant update, I feel compelled to redo the video.

    I have started using xdotool [1] to create bash scripts that send mouse clicks and keystrokes to apps. Interleaving calls to xdotool with the "sleep" command [2] produce a convincing effect. If I need to redo a video to fix typos or after a program update, I just fix the bash script and restart the recording.

    Alas, the only thing that is missing in my videos is the sound of keyboard clicks… But nothing is perfect!

    [1] https://github.com/jordansissel/xdotool

    [2] https://en.wikipedia.org/wiki/Sleep_(command)

  • piku

    The tiniest PaaS you've ever seen. Piku allows you to do git push deployments to your own servers.

  • z-saw

    Play sawtooth waveforms using the NES's DMC channel in a small and game-friendly library.

  • Very carefully scheduling NMI and IRQ updates to achieve a virtual sound channel on an old NES, resulting in a sawtooth bassline with volume control. This steals about 13% of the CPU time. The biggest hack in the arrangement is the scheduling of OAM DMA to sneakily just barely fit between timed audio updates, since it pauses the CPU and would otherwise cause an audible glitch. Among other things, if NMI notices that it interrupted IRQ, it apologizes profusely and exits immediately, which is a rather unusual workaround on 6502 systems.

    I've open sourced the technique with a more detailed writeup [1] and I like to think the game I created with it is pretty fun, [2] but of course that's subjective. You can try it in your browser here. [3]

    [1] https://github.com/zeta0134/z-saw

    [2] https://zeta0134.itch.io/tactus

    [3] https://rusticnes.reploid.cafe/wasm/?cartridge=tactus.nes

  • Colorbot

    Discontinued This Discord bot uses SadConsole to render colored messages

  • 5. The job we pushed then saves the Console to a PNG in a memory stream (file operations were substantially slower in thread for some reason), and then calls Discord API to send the response.

    I'm personally proud of this because I used MonoGame in a way that it was not intended for.

    The code worked at the time it was written. Unfortunately, it does not work anymore at this time (likely due to some API update).

    The code is available here: https://github.com/INeedAUniqueUsername/Colorbot/blob/master...

  • musl-sem-ext

  • A few years ago, the company I work at switched to using Alpine-based docker images for most containerized things. One side effect was that our Ansible playbooks (running from inside one of these containers) would fail with inconsistent network timeouts when targeting a couple thousand servers. It turned out that the issue wasn't with the network nor with Ansible. The way that Ansible invoked some library functions for keeping track of SSH connections caused it to create a bunch of POSIX semaphores via sem_open().

    glibc had a dynamically allocated data structure to keep track of semaphores, but musl libc only had a fixed-size 256 element array. When the semaphore limit was exhausted, Ansible would fail to keep track of the connections, resulting in a network timeout error message. I fixed the problem by forking musl's semaphore functions, making the array resizable, and loading the implementation with LD_PRELOAD: https://github.com/chenxiaolong/musl-sem-ext. Worked perfectly for 6 years until we decommed our data center :)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Chrome-dino-auto-run

    Autonomous Chrome Dino to Hit High Score of 7332. Using OpenCV, Numpy and PIL

  • Had internet outage one day, and i managed to write python script to make the chrome dino run autonomously, without any tweaks to the game and did through screen capture.

    https://github.com/GokulDas027/Chrome-dino-auto-run

  • smc

    Simple Memory Check

  • freebsd-update-probe

  • https://github.com/tux2bsd/freebsd-update-probe

    freebsd-update is broken, it does internal spaghetti which prevents it from doing the most logical thing first: "check upstream for updates"

    I created a work around, it works well.

    I don't use FreeBSD, but it's good for a hobby OS. Has a few cool ways to do things (seperation of OS vs external software & /etc/rc.conf). The project is coasting on ZFS success.

    They HATE me at the FreeBSD Forums. I don't think a single one of them truly understood what freebsd-update-probe actually achieved.

    I'm not a programmer.

  • semanticText

    Copy paste tool that analyzes the semantic description of all text in the DOM

  • tnds-tomasi-notebooks

    Notebook usati per il corso di TNDS

  • Sure, here is one of them:

    https://github.com/ziotom78/tnds-tomasi-notebooks/blob/maste...

    And here is the recording, made with asciinema:

    https://asciinema.org/a/544981

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts