Ask HN: Programs that saved you 100 hours?
629 pointsI learned about a ton of useful CLIs, desktop apps, and SaaS products from this thread (https://news.ycombinator.com/item?id=13887237).
But it was posted 3 years ago, and perhaps some useful stuff has emerged in the interim, hence my starting this thread.
Comments (516) 196 threads
Earlier commentsSure, you can use your IDE to achieve some of this, but this is where the 80/20 rule really breaks down: since each IDE differs in the details, at some point auto-formatting the code is going to waste more time than it saves by having to undo or work around mutually incompatible formatting rules. You can't reasonably expect everyone to use the same IDE, but you can expect them to use the same Makefile targets and CI pipeline.
Here's a config file for running some of these checks with https://pre-commit.com/ both locally, and then again on CI:
https://github.com/kogan/django-subscriptions/blob/master/.p...
https://github.com/kogan/django-subscriptions/blob/master/.c...
Black and isort complement each other in formatting your code, and both have flags to check whether they would change anything in your code. You can do the former either as a script or Makefile target, and the latter in CI to verify that the code is actually lint-free.
flake8 is your standard linter - it checks for idiomatic Python. I prefer to set it quite strict, with `max-complexity` starting at something like 4 and only moving it up if I really can't figure out a way to make the code simpler. And you shouldn't have to ignore any lints unless there's a linter or formatter bug or conflict. The only place I've seen this is with E203.
mypy is a tricky one if you're not yet used to Python type hints. I would recommend starting with no configuration and then introducing stricter rules as you understand more of them. My current go-to configuration sets all of check_untyped_defs, disallow_any_generics, disallow_untyped_defs, ignore_missing_imports, no_implicit_optional, warn_redundant_casts, warn_return_any, and warn_unused_ignores.
To list all the files in your project tracked by Git (because you don't want to lint or format any third party files) NUL-terminated (because you want to handle weird file names) run `git ls-files -z -- '[star].py'`. To instead list only the files changed from origin/master (your typical target branch for a merge request) except for those you've deleted locally you can run `git diff --diff-filter=d --name-only -z origin/master -- '[star].py'`. You can then pipe the result of either command to `xargs --no-run-if-empty --null black` and similar. Use the first Git command in CI to lint all the files, so that you don't miss out on any changes for example when any of the linters change their rules. Use the second Git command locally to format and lint your changed code. And make sure you have some way to force formatting/linting all the code for when you update any of these programs.
Finally, running all the linters as part of a pre-commit hook is a great way to make sure you never commit broken code. Having a bunch of lint fixup commits is ugly and counter-productive.
Start with black. It's very easy to setup, and the reward is great.
Learning the YouTube APIs saved me thousands of hours on editing video metadata, organizing playlists, etc (https://github.com/cgranier/pytube).
Everything (https://www.voidtools.com/) is a wonderful file search tool for Windows.
Thanks for all the links and ideas... new things to try this week.
- setting up a personal vpn with a reserved IP if you connect to services that require your IP to be whitelisted and you move often
- for git cli: dashes take you back to your previous location (eg `git checkout -` will take you back to the previous branch). On zsh: `cd -n` will take you to n directories ago
Mac only:
- the Paste clipboard manager has been a most delightful tool, though I don’t know if I’ll ever upgrade to the new subscription version: https://pasteapp.io/
- the workflows feature in Alfred.app as a convenient place to keep utility applescripts / other kinds of little scripts that you want to invoke through global shortcuts or through Alfred
The thing that finally made this worthwhile for me is GNU stow.
https://alexpearce.me/2016/02/managing-dotfiles-with-stow/
Stow is available from homebrew if you prefer to get your Mac stuff that way.
What are you thinking about switching to?
Continue this thread — 3 replies
Last year it looks it launched a sharing interface with what looks like a non-trivial backend to it. In January, a rewrite of Voice Boost and support for Air Play 2 was released. So it's pretty actively developed.
What kind of features do you think is lacking? I feel like I have very simple needs. The only time I've wanted for something is occasionally wishing to use it on my desktop and the web interface is okay-ish for those brief periods.
It definitely isn't the same thing. I kinda understand why you think that way, but it's pretty much completely illogical (see avoiding ever skim reading anything written by someone, or never fast forwarding any filmed media where a person is speaking).
All comments shown.
Couldn't load more comments. Check your connection and try again.