Live data from Hacker News

Ask HN: Weirdest hack that you ever saw in production?

news.ycombinator.com

101–110 of 289 posts

Re: Ask HN: Weirdest hack that you ever saw in production?

#101
post #84

In a consumer app, I would say Snapchat's early camera hack on Android takes the cake. To be brief, their app ran the Android native camera app in the background and took a screenshot of the resulting feed for the image, bypassing actual integration with Android's camera apps. Having worked on an Android smartphone from the ground up, I can understand their reluctance to commit dev time to having to support so many A…

This is hilarious as Snap Inc. bills itself as a "Camera Company"

Re: Ask HN: Weirdest hack that you ever saw in production?

#102
In the midnineties I was hired to improve the performance (and eventually rewrite) a custom in-house search engine. I dipped into the software and there were some quick wins, but I couldn’t get the damn thing to reply quicker than 100 ms. In desperation I just grepped for the number 100 and sure enough I found a 100 ms sleep in the routines handling the connections. Turned out the author had made a mess of his socket handling and by trial and error had found out he could get the thing to work reliably only by waiting for a while.

Re: Ask HN: Weirdest hack that you ever saw in production?

#103

Not an actual bug, but I found this a couple of days ago. And it seems like an elegant hack, allowing `/` in directory, files, etc. Typing `mkdir foo:bar` in my macOS's terminal leads to a directory, that Finder shows as `foo/bar`.

Classic Mac OS (<10) used : as a directory separator, so it's probably related to that.

Re: Ask HN: Weirdest hack that you ever saw in production?

#104
post #42

Earlier quoted context omitted.

I use a posh script like this when i dont want the computer to lock. $ws = New-Object -COM wscript.shell; while($true){ $ws.SendKeys("j"); Sleep 60;} Ive used it for demos that way the computer doesnt lock before the demo starts, its pretty short and easy to remember. Also on windows if you spam SendKeys("{Left}") everything you type is backwards and when you hit the windows key it freezes the computer in an interest…

I used to use autohotkey to send an F13 key press every couple minutes to avoid lockout on a work computer where I wasn't allowed to increase the timeout

Wait is Function keys above F12 still addressable?

Re: Ask HN: Weirdest hack that you ever saw in production?

#105

In my startup days, we were working on a proof of concept with a really big bank. Because of their security rules, we couldn't have direct access to their systems - so if we wanted to do something remotely, we would have to start a webex, they would join and share their screen, and give us remote control. This worked great, except if we wanted to work over the weekend, since if we left the screen alone for more than…

I use a posh script like this when i dont want the computer to lock. $ws = New-Object -COM wscript.shell; while($true){ $ws.SendKeys("j"); Sleep 60;} Ive used it for demos that way the computer doesnt lock before the demo starts, its pretty short and easy to remember. Also on windows if you spam SendKeys("{Left}") everything you type is backwards and when you hit the windows key it freezes the computer in an interest…

[deleted]

Re: Ask HN: Weirdest hack that you ever saw in production?

#106

In my startup days, we were working on a proof of concept with a really big bank. Because of their security rules, we couldn't have direct access to their systems - so if we wanted to do something remotely, we would have to start a webex, they would join and share their screen, and give us remote control. This worked great, except if we wanted to work over the weekend, since if we left the screen alone for more than…

Ha - amused to read this! Just built that a week ago for my partner. I used an Arduino connected to the USB as HID. The approx. 10 line script is moving the mouse back and forth every couple of seconds. Works like a charm: keeps the screen unlocked and her activity indicator busy...

Re: Ask HN: Weirdest hack that you ever saw in production?

#107
Sony PSX (original playstation) port of a PC title that I worked on, we needed to have a physics thread run at a predictable and consistent rate regardless of what the rest of the game was doing. Sony Japan said pre-emptive multi-tasking wasn't possible.

Found a way to hook the vertical blank interrupt (shades of old Atari 8-bit programming), push all the registers onto the stack to create a setjmp/longjmp-ish way to call our physics thread at a consistent 30Hz. (OK, 29.97, but close enough)

Re: Ask HN: Weirdest hack that you ever saw in production?

#108
post #8

I worked at a place that had a large, distributed terminal network running on something like OSF or DEC Unix. It was 2001 and the thing was on life support while PCs were being rolled out. I was helping to rack my new database servers, which was next to this big lab table/shelf combo with like 16 terminals on it. When pulling a cable I banged my head on the table, then this big book fell on my hand. About 10 minutes…

I've got one of those from "Only on WIndows" series. One of my colleagues uses WIndows and tends to remote in from home. Unfortunately when a cleaner cleans the office after hours she sometimes accidentally hits the CAPS key and he can't log in anymore remotely. His solution was to rip out the CAPS key and cover the hole with duct tape.

I use AutoHotKey to remap it to launch TotalCommander.

Re: Ask HN: Weirdest hack that you ever saw in production?

#109
post #65

Not sure if this is still the case, but back when I was at Apple the program that triggered when you pressed a button on an Apple remote pointed at a Macintosh was just a giant AppleScript file that, at the top level, was a giant `if...else if...` statement to try and determine which application had the foreground so that the appropriate action (e.g. next track for iTunes, next slide for Keynote, next chapter marker…

Interesting! The only .scpt files I can find in /System are Automator actions or in Script Utility itself, and of those the only one that seems relevant is Library/Automator/Initiate Remote Broadcast.action/Contents/Resources/Scripts/main.scpt, which seems like something else. Hopefully that means they fixed it (if someone with an apple remote wants to run opensnoop and double-check that would be cool!)

I think I remember this from the days of Front Row. It’s long gone now.

Re: Ask HN: Weirdest hack that you ever saw in production?

#110
post #42

Earlier quoted context omitted.

I used to use autohotkey to send an F13 key press every couple minutes to avoid lockout on a work computer where I wasn't allowed to increase the timeout

Wait is Function keys above F12 still addressable?

It’s Windows, so backwards compatibility mandates F13-F24 exist.
Post reply on HN