Live data from Hacker News

Ask HN: Small scripts, hacks and automations you're proud of?

news.ycombinator.com

51–60 of 340 posts

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#51

I inadvertently caused a VERY VERY large corporation that is a household name to change its TOS through one of my little automation scripts. By little, I mean a few dozen lines of code and some ingenuity. The corp in question: Begins with V and ends with z and likes to screw customers. All above board, approved by several levels of various teams/depts. The head of a specific dept sent me several strongly worded texts…

The corp in question: Begins with V and ends with z and likes to screw customers.

Typo? Maybe ends with n?

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#52

Rewrote grabbing car sales ads from Selenium to Playwright and exported the data of a specific search to a spresdsheet. Could easily derive trend lines for price over mileage and price over age and since there is a nice unified JSON somewhere in each page with all the features per car, I could see if a more expensive one was worth it due to more features, or not. Served me well when buying but also selling a car.

WANT

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#53

So certainly not impressive, and morally ambiguous, but when chatGPT first released, I worked with it to create a python script that crawled The New Yorker sitemaps, found articles with embedded audio versions, downloaded the mp3 by reconstructing the file url using the article ID in the page source, and then renamed the file to match the page title and saved it to a well structured Google Drive directory. Now when I…

Pretty impressive to be able to create such a script when you haven't programmed before. I used to freelance when I learnt to code in college and I wrote many such small automation scripts for quite a few people. Looks like the AI is already taking away some jobs ;)

[flagged]

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#54

I made a small script to get weekly recipes with certain macronutrient composition from chatgpt, then i linked the ingredient list with my supermarket’s api so every monday I get delivered everything

How have you found the quality of chatgpt’s recipes?

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#55
The time that my boss promised that we could write an AppleScript for InDesign which would allow adding an index to an InDesign document --- turns out it was 4 levels deep, and when I asked about doing this on the InDesign mailing list, Olav Martin Kvern who was then Adobe's Scripting Evangelist declared that it was impossible, because only the first level had support.

After a bit of experimentation I determined that it was necessary to verify the existence of a given index entry at a given level, and that if it existed, one could add additional entries --- if it didn't exist, then it was necessary to create the level above as an index entry, and then it was possible to add the new one.

I probably have the code somewhere, but haven't done any Applescripting for a while now (kind of miss it, Powershell is nowhere as comfortable, and there doesn't exist an equivalent to Application Dictionaries).

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#56
post #9

In 2004, the website All Music Guide did a horrible redesign. I was so irritated that I created a Firefox extension that did only one thing — it made All Music Guide a bit more useable. To my knowledge, this was the first "site-specific" browser extension, so I wrote a blog post about it: https://www.holovaty.com/writing/all-music-guide/ Aaron Boodman saw my post and decided to generalize the idea; he created Greasem…

In that case, thank you to you both for dramatically improving my web experience -- I don't know that I could stand browsing without uBlockOrigin and ViolentMonkey

I'm not aware of any browsers that support it natively, although TBH there are so many random Firefox forks that any one of them could have just bundled the extension and called it native

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#57
post #41

If you add a .CMD file as the first entry in a .ZIP, with compression set to "none", you can rename and run the .ZIP as a .CMD, because the PK header will be treated as a nonexistent command and execution will continue after that. With a little imagination and some PowerShell I've made that into a self-extracting archive. It's a dirty hack, but I've had it working in production for years now. I want to see if I can m…

> I can make the batch file chimeric so it can run in a linux shell as well. Maybe that'll to be my lazy Sunday afternoon?

You may want to draw inspiration from the latest incarnation of JetBrains build bootstrapping script:

https://github.com/JetBrains/intellij-community/blob/idea/22...

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#58

This is more in the "hack" category, but here is a solution for bookmarking directories[1] that I am quite fond of: mkdir ~/.marks/ export CDPATH=.:~/.marks/ function mark { ln -sr "$(pwd)" ~/.marks/"$1"; } Then: mark @name # add bookmark called @name for the current directory cd @name # jump to the bookmarked location cd @ # list all available bookmarks It can list bookmarks, auto-complete, jump to sub-directories w…

Awesome snippet! I organize most of my work using something similar to the Johnny decimal system[0] and use CDPATH for quicker lookups. But I love how you build a dynamic system with a simple oneliner!

[0] https://johnnydecimal.com/

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#59
I made a fzf-powered tool that makes cd'ing into deep directory trees quite fast and easy. It's somewhat reminiscent of ranger/nnn/broot, but in my mind, it eliminates the mental context switch of entering/exiting those tools.

Some gifs (with speed comparisons) here: https://github.com/dp12/probe

Re: Ask HN: Small scripts, hacks and automations you're proud of?

#60

Earlier quoted context omitted.

Pretty impressive to be able to create such a script when you haven't programmed before. I used to freelance when I learnt to code in college and I wrote many such small automation scripts for quite a few people. Looks like the AI is already taking away some jobs ;)

[flagged]

Dey took er derbs
Post reply on HN