News for hackers. Stuff that matters.
Re:I Prefer Semi-Automation by nicbou on Saturday January 07, 2023 @04:04AM (#34286423)
Automation is not just about saving time. It’s also about saving a “recipe” for a task, about avoiding human error, and about staying in the flow.

I automated logging into my website’s admin area to edit a post. Now I type “edit” in the address bar. I must have used that shortcut a thousand times in 2022. P

I have another that cd into a project and launch the dev environment. Same deal.

If you get sidetracked a lot, automation is critical. It’s our industry’s equivalent to mise en place. Deal with the drudgery in advance to focus on your work when it matters.

Re:I Prefer Semi-Automation by greatNespresso on Saturday January 07, 2023 @04:28AM (#34286573)
> I automated logging into my website’s admin area to edit a post. Now I type “edit” in the address bar. I must have used that shortcut a thousand times in 2022.

Cool !! Maybe one of the best illustration of a frequent task indeed!

Re:I Prefer Semi-Automation by alexdowad on Saturday January 07, 2023 @04:59AM (#34286737)
What browser do you use? How do you create shortcuts which can be accessed by typing in the address bar?
Re:I Prefer Semi-Automation by jo1gi on Saturday January 07, 2023 @05:04AM (#34286758)
In firefox you can give a bookmark a keyword that you can then write in the address bar to open it. It can also be used for adding search engines.
Re:I Prefer Semi-Automation by bmacho on Saturday January 07, 2023 @05:26AM (#34286861)
That bookmark can be a bookmarklet/javascript as well, so you can run commands typing in the address bar and hitting enter.
Re:I Prefer Semi-Automation by Noumenon72 on Saturday January 07, 2023 @10:01AM (#34288557)
I've used both things but never considered combining them. Very clever.
Re:I Prefer Semi-Automation by nicbou on Saturday January 07, 2023 @06:14AM (#34287069)
That's exactly it. A Javascript bookmarklet with an assigned keyword ("edit").
Re:I Prefer Semi-Automation by swyx on Saturday January 07, 2023 @09:02AM (#34288016)
care to share it so i can crib off of you? oddly enough i write javascript all the time but never ever really got comfortable writing "bookmarklets"...
Re:I Prefer Semi-Automation by nicbou on Saturday January 07, 2023 @10:36AM (#34288948)
This is the code:

    javascript:void(window.open(document.querySelector('head%20%3E%20link%5Brel=edit%5D').href,%20%20'_blank'));
It relies on the page having a <link> tag with the URL to the admin panel.
Re:I Prefer Semi-Automation by tpmx on Saturday January 07, 2023 @08:36AM (#34287836)
You can abuse the Chrome custom Site Search feature to achieve the same. You don't have to use the %s argument substitution thing.
Re:I Prefer Semi-Automation by Noumenon72 on Saturday January 07, 2023 @09:59AM (#34288541)
I do this without %s to go to dev, qa, or prod: ad/aq/ap for Airflow, kd/kq/kp for Keycloak.

I also started using custom searches for every new technology. I know I'm going to be googling "kubernetes foo" or "Elasticsearch bar" 1000 times in my life, so I just make a "k8" or "es" search engine right from the start. Also "diff %s" for "difference between".

Re:I Prefer Semi-Automation by yamasanama on Saturday January 07, 2023 @07:24AM (#34287425)
> It’s our industry’s equivalent to mise en place.

What an excellent comparison! Thanks!

Re:I Prefer Semi-Automation by maliker on Saturday January 07, 2023 @09:06AM (#34288044)
I think it’s fair to say that in the age of the internet, everyone is sidetracked all the time.

Another thing I like about automation is that it lets you think bigger thoughts. If I have to go in and tweak a report in Excel, I’m only going to have time to do the bare minimum to get the result I need. But if I load it into pandas, some additional analysis is only a single command away, so I’ll probably do it. And with the rise of AI tools like chatGPT, I don’t even have to remember the commands, I just ask the AI “hey, come up with a forecast for this variable”.

Re:I Prefer Semi-Automation by NGRhodes on Saturday January 07, 2023 @11:30AM (#34289591)
Worth reading about Autonomation (https://en.wikipedia.org/wiki/Autonomation), which originated in Toyota. "Autonomation aims to prevent the production of defective products, eliminate overproduction and focus attention on understanding the problems and ensuring that they do not reoccur. "
Re:I Prefer Semi-Automation by nicbou on Saturday January 07, 2023 @11:38AM (#34289680)
Yep. I was really into the TPS a while ago, and autonomation is a concept that stuck with me.
Re:I Prefer Semi-Automation by tikhonj on Saturday January 07, 2023 @11:58AM (#34289944)
> I have another that cd into a project and launch the dev environment.

I have this set up with direnv[1] and it's incredibly useful, especially with Emacs integration. Not only does it reduce the cognitive burden of keeping track of whether I've opened a venv/launched a nix shell/etc, but it also prevents time-wasting mistakes like launching the wrong version of an interpreter or compiler.

[1]: https://direnv.net/

Re:I Prefer Semi-Automation by actinium226 on Saturday January 07, 2023 @12:14PM (#34290160)
I guess my solution to this problem is not very popular - I try to keep my dev environment simple enough that I don't need venv or anything like that. I find that venv or docker adds cognitive load that then needs more tools to unload, like direnv.

So if my devenv gets too complicated I try to simplify it. Seems like a logical solution to me but often I run into people who simply don't believe me that it makes things simpler. :shrug:

Re:I Prefer Semi-Automation by nicbou on Saturday January 07, 2023 @02:36PM (#34291753)
At some point your code has dependencies that call for this.
Re:I Prefer Semi-Automation by satvikpendem on Saturday January 07, 2023 @11:08PM (#34295923)
> I guess my solution to this problem is not very popular - I try to keep my dev environment simple enough that I don't need venv or anything like that. I find that venv or docker adds cognitive load that then needs more tools to unload, like direnv.

Good for you but this doesn't work in most scenarios, especially if you work in a company with a build process.

Re:I Prefer Semi-Automation by codemonkey-zeta on Saturday January 07, 2023 @02:03PM (#34291391)
I'm really interested in setting this up also. Can you briefly explain how you set this up with direnv? Looks like that's just for loading environment files, not launching processes?
Re:I Prefer Semi-Automation by ywei3410 on Saturday January 07, 2023 @06:33PM (#34294225)
Emacs launches processes on the `PATH` so using `direnv`, you can change the `PATH` to the version of `rust-analyzer`/`gopls`/`python`/`psql`/`protoc` that you're using as well as setting the correct load paths for each language.