Live data from Hacker News

Ask HN: What's your proudest hack?

news.ycombinator.com

101–110 of 414 posts

Re: Ask HN: What's your proudest hack?

#102
post #50

My proudest hack and the hack I'm most known for both happened at the same company. My proudest (and also maybe least proud at the same time) was writing a BASH script that was able to successfully replicate a complex server environment that had been previously built by contractors for an essential service that we needed to re-deploy, both for growing regions, but also to resolve a possible security issue due to how…

I basically have done the same thing on both occasions except the first one I have oddly done multiple times. One of the occasions still felt like I wasted all of my time and effort too because it was for a custom HPC environment(I was performing a major OS upgrade that also involved getting a lot programs to work on a 64 bit OS when they were originally written for a 16 or 32 bit OS) that was trashed within two months after the environment was fully up and running. The client not only bought new hardware(after repetitively telling me they wouldn't have a budget to do that for a couple of years) but also pulled a 180 on the decision that certain Opensource tools could be used within the environment after a code review and approval process was completed.

Did you try to recover the corrupted windows partition table first using either Testdisk by CGSecurity or Hiren's BootCD? If it was on a UNIX or Linux file system that sort of thing can be recovered a lot easier thanks to alternate superblocks and the ability to basically copy the partition sectors from another disk that is the same size with the same partitioning thanks to the dd command.

Re: Ask HN: What's your proudest hack?

#103
I migrated 5 independent svn repos into a single git mono repo while maintaining history.

1. Synced all 5 using git-svn into 5 branches

2. Used filter branch to rewrite each into its own folder

3. Handcrafted a single merge commit that combined all 5 branches into one

Re: Ask HN: What's your proudest hack?

#104
I once realized it was trivial to dynamically load a ruby class & module on a request-by-request basis in a rack app, which invented an easy way for a group of non-programmers to modify a rails apps views by overloading methods in a file called FooBarCom.rb where FooBarCom could be any domain the app was hosting. :-)

Re: Ask HN: What's your proudest hack?

#105
When I was in highschool I wrote a Tetris game for the TRS-80. My clever hack was that I could make it twice as fast by keeping the state of the falling shapes in video memory instead of a separate object model. In an early version of this, I failed to completely draw the "cup" the objects were falling into, and one fell straight through the bottom into system memory and crashed the machine.

Re: Ask HN: What's your proudest hack?

#106
Honestly, probably futzing around with Prince of Persia level assets in ResEdit to bypass the piracy check, as a child. My capacity for pride diminished with exposure to the world.

More recently, replacing `7z.exe` with a PowerShell script that logged input, to get archive passwords for an obfuscated data format. Not technically impressive at all but a few days were saved and lolz were had.

Re: Ask HN: What's your proudest hack?

#107
I mix [heavy cream powder] and powdered milk in equal portions to make half-and-half that I can keep at my desk without refrigeration. I keep it in [baby formula dispenser]s so I can shake it up for homogeneity and dispense it without digging in with a spoon.

[heavy cream powder]: https://www.amazon.com/Anthonys-Fillers-Preservatives-Friend...

[baby formula dispenser]: https://www.amazon.com/Philips-AVENT-Powder-Formula-Dispense...

Re: Ask HN: What's your proudest hack?

#108
post #105

When I was in highschool I wrote a Tetris game for the TRS-80. My clever hack was that I could make it twice as fast by keeping the state of the falling shapes in video memory instead of a separate object model. In an early version of this, I failed to completely draw the "cup" the objects were falling into, and one fell straight through the bottom into system memory and crashed the machine.

I did the same for a snake game for the TI-83. I didn't think of it as a clever hack so much as it was inexperience; I figured it's how games normally worked. System dialogues like "your battery is low" suddenly became parts of the playing field which was funny if nothing else. My code was slow enough that I didn't need any sleeps or busy loops, maxing out the CPU with my inefficient code just turned out to be the right playable speed which didn't occur to me as a coincidence until much later

Re: Ask HN: What's your proudest hack?

#109
After playing a lot of Tetris Friends, I started getting deja vu. Sometimes, after starting a new game and placing maybe 10-20 pieces, I would think, "Haven't I seen this exact board before?" Eventually I tested my theory through brute force: I would start a fresh game, write down the first 10 pieces, then restart. Over and over and over, until finally, I found it -- a duplicate!

Apparently, Tetris Friends only seeded their RNG once, and there were only a few hundred possible seeds (perhaps 256? I didn't check). So if you got the same initial seed, you got the exact same pieces for the entire game. Tetris Friends also happened to have a highly competitive global leaderboard, where you tried to clear 40 lines as fast as possible... and I happened to have recently learned how to use AutoHotKey. You see where this is going.

I restarted over and over until I got a good seed, then carefully played through a whole game, copying my inputs into a giant AutoHotKey script. Tetris Friends was a flash game, meaning it could only process so many inputs per second, so I had to insert a short delay between each input. Testing/debugging was a nightmare too, because I had to restart until I found the same seed again! But after a few hours, my script made it all the way through a game, and bam, I was #1 in the world.

Felt real good for about a week, until Tetris Friends purged the leaderboard. :^)

Re: Ask HN: What's your proudest hack?

#110
Not the one I'm most proud but at least this one I can explain.

I initial did it to help a friend who wanted to customize and sell bycicle bells. since most printing techniques are made for flat surfaces this creates an interesting challenge. The solution I eventually arrived at involves a pen plotter and a custom fixture. There's actually a article about it here: https://www.evilmadscientist.com/2019/bike-bells-with-axidra...

And by the way, the obvious way to produce them would probably using transparent stickers a heat gun an a coat of varnish but where's the fun in that.

Post reply on HN