Re:Diving into Go by building a CLI application
by radicalriddler on Tuesday May 26, 2020 @09:11PM
(#23318352)
I had a similar idea a couple of months ago. Make a CLI in golang that allows me to easily open all my favorite timewaster sites at the start of the work day. But it ended up in the "Started, but never looked at again" pile. Maybe I'll have another look at it on the weekend.
[ Parent
| on HN ]
Re:Diving into Go by building a CLI application
by eryb on Tuesday May 26, 2020 @09:23PM
(#23318425)
Same thing with me, however I am forcing myself to complete pending projects in this Covid lockdown.
Trust me it is always difficult to restart work on pending projects, once you give it two minutes you'll get glued to it.
Just force yourself to get started.
Re:Diving into Go by building a CLI application
by hybridbanner on Tuesday May 26, 2020 @10:11PM
(#23318695)
One method I've used which puts some additional pressure on me to work on side projects is to write them out in the open in a public GitHub repo. Even though there's probably nobody following your development, the idea that anyone could be following along can provide some motivation to keep going.
Re:Diving into Go by building a CLI application
by moreaccountspls on Wednesday May 27, 2020 @12:52PM
(#23326115)
Is your goal to learn go (or other language), or to accomplish a specific task (both valid and wonderful goals!)? The reason I ask because if it's the second, I've become dramatically more productive by really learning shell. Just as an example:
comic_number=321; curl -L http://xkcd.com/"$comic_number"/info.0.json | jq '{title, number: .num, title, date: "\(.day)-\(.month)-\(.year)", description: .alt, image: .img}'
That took maybe a minute for me to write, vs. like 20 or so minutes for Go. I personally can get stuck in a such a paralysis of doing things the "right" way in a "real" language. So, it's nice to be able to bang out a prototype super quickly and then iterate from there if I want.edit: getting them all, because who can resist some fun code golf:
yes | awk 'BEGIN{count=1} {print count++;}' | head -n 2311 | xargs -I {} curl -sL http://xkcd.com/"{}"/info.0.json | jq '{title, number: .num, title, date: "\(.day)-\(.month)-\(.year)", description: .alt, image: .img}'
Re:Diving into Go by building a CLI application
by toomuchtodo on Tuesday May 26, 2020 @09:26PM
(#23318454)
In case you don’t get around to writing that golang code.
https://unix.stackexchange.com/questions/17659/opening-multi...
Re:Diving into Go by building a CLI application
by mikewhy on Tuesday May 26, 2020 @11:21PM
(#23319057)
Also could be handled via `open` (macOS) / `xdg-open` (Linux) / `start` (Windows).
Re:Diving into Go by building a CLI application
by mav3rick on Tuesday May 26, 2020 @11:58PM
(#23319259)
No need for a while loop. Just have a file with each site name in a new line. Then -
cat sites-list | xargs -n1 firefox --new-tab
Re:Diving into Go by building a CLI application
by eryb on Tuesday May 26, 2020 @09:50PM
(#23318588)
This is so nice
Re:Diving into Go by building a CLI application
by yjftsjthsd-h on Wednesday May 27, 2020 @01:30AM
(#23319650)
By all means write code if it's fun, but couldn't you just make a bookmark folder and right click > open all?
Re:Diving into Go by building a CLI application
by dinkleberg on Tuesday May 26, 2020 @11:45PM
(#23319173)
If you're on mac, Alfred makes it super easy to create workflows like this. I've sped up the time to goofing off drastically !