Live data from Hacker News

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

news.ycombinator.com

171–180 of 340 posts

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

#172

On Windows: - Created a folder called "shortcuts" - Copy the folder URL into the system path (Control Panel, Environment variables something something) - Create a shortcut of anything I want to hyperlink to and put in there, with descriptive names - In IE, I think the setting was to enable autocomplete. For some reason that was linked to the autocomplete of the run menu item in Windows. - For extra bonus points, add…

Re: Mac — Hammerspoon?

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

#173

Maybe this already exists somewhere and I don't know about it ... Anyway, when working on feature branches I wanted a quick way to switch to master, pull, switch back and finally rebase. So I made a little script ( https://gist.github.com/lelanthran/6c9bd1125f89e7621364878d1... ) that pushes the current branch name onto a stack before switching to a new branch, and allows me to switch back to the topmost branch on th…

You can update a branch without checking it out: git pull origin master:master Still, two commands..

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

#174

There is a specific small hotel that will remain unnamed, which my partner wanted to book for a long long time. At any given moment if you check the reservations page, it is most likely booked for two years solid. It is famous enough that people book it all the time, but it has lenient cancellation policy of 100% refund if cancelled before 2 weeks. This is not really a problem for them as these vacancies get booked i…

Was the hotel in NZ? And do you work on a three headed beast?

No, and - not sure I understand the question - but most likely, also no.

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

#175

I made a CLI tool for quickly starting new branches with draft PRs, asking for reviews, etc: https://github.com/dbalatero/work-cli Made a bunch of Hammerspoon plugins for macOS: - https://github.com/dbalatero/SkyRocket.spoon - mod+click to resize/drag windows - https://github.com/dbalatero/VimMode.spoon - Vim mode everywhere - https://github.com/dbalatero/HyperKey.spoon - pop-up menu for when you forget your keybinds…

oh I've been down the "I can just fix macOS" road. The sooner you move away the better. so much time wasted on plugins like these.

you effort will just be null the second apple change the usability apis enabling hammerspoon, like they did countless times before. I don't even rename the name of the fallen apps before it.

instead now I contribute things as long lived proper features on KDE and hopefully advance humanity instead of apple profits.

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

#176

Maybe this already exists somewhere and I don't know about it ... Anyway, when working on feature branches I wanted a quick way to switch to master, pull, switch back and finally rebase. So I made a little script ( https://gist.github.com/lelanthran/6c9bd1125f89e7621364878d1... ) that pushes the current branch name onto a stack before switching to a new branch, and allows me to switch back to the topmost branch on th…

it’s not a stack, but you can toggle to the prior branch with `git checkout -`

Or to move back N branches you can do: `git checkout @{-N}`

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

#178
I wrote a small python script for work that checks the time I have clocked in at work, checks how long I have to work that day and then recommends me the best time to leave to get the bus. The time is available via the time management website from work and the public transport API. It works surprisingly well and has saved me a little time every day.

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

#180

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…

I just use ranger and mark/bookmark directories like in Vim.
Post reply on HN