Ask HN: Small scripts, hacks and automations you're proud of?
71–80 of 340 posts
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#72Re: Ask HN: Small scripts, hacks and automations you're proud of?
#73Re: Ask HN: Small scripts, hacks and automations you're proud of?
#74I have a script listed in package.json for my site. Often I don't really care about commit messages here, not because I don't find them valuable, but because so often its from editing and publishing articles. I don't really want to think of messages all the time so often end up typing random crap. I use this now: import { execSync } from 'child_process'; execSync('git add -A'); const modifiedFiles = execSync('git sta…
Ooo that's nasty... I love it! Much better than "Changes", "Update" or "WIP".
Every time I'm tempted to figure out how to squash/collapse the entire history down to a single commit and then always use that script.
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#75 git-clean-squashed
Which finds all squash-merged branches in the current Git repo, and warns you before deleting!https://github.com/benwinding/dotfiles/blob/master/bin/git-d...
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#76If 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…
If you run a "cls" as first command in the batch file no one would notice the invalid command of the PK header either (and not get possibly confused).
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#77Re: Ask HN: Small scripts, hacks and automations you're proud of?
#78Re: Ask HN: Small scripts, hacks and automations you're proud of?
#79All of my favorite things are little AutoHotkey shortcuts. I have several that basically just execute a Regex replace on whatever text is currently highlighted. It's ridiculously convenient to just have those functions ready to go any time. But I started accumulating so many of them, it got to be a problem just remembering all the ones I had and how to trigger them. I had to start finding new ways of keeping them all…
I'm approaching your threshold of "I started accumulating so many of them, it got to be a problem just remembering all the ones I had and how to trigger them" Can you share a repo with your "custom right-click menus and Emacs-style keychords" to save me some time? Love hacker news!
- Key chords: https://gist.github.com/CFiggers/ccb6bc911ee87f423f558368128...
- Right-click menus: https://gist.github.com/CFiggers/96bc37ca468909c9ec83252144c...
Let me know if you have questions. Enjoy!
Re: Ask HN: Small scripts, hacks and automations you're proud of?
#80The hotel website itself is inordinately difficult to search more than 1-2 nights (each day takes 6-8 clicks to search), but it’s all queryable through an undocumented API, so I wrote a small CLI tool in Crystal that can scan the next 60-90 days (configurable, of course) to see if there have been any sudden openings.
It does it all in parallel, so I can find out within about 10 seconds if there are any rooms available within a 30 (or longer) day range.
It’s already helped booked one wedding anniversary trip and one special getaway for 2 friends. I don’t use it often, but it’s wonderful to have around.