dream_weasel
- 1 Post
- 6 Comments
dream_weasel@sh.itjust.worksto Ask Lemmy@lemmy.world•You can guarantee a random 10% of the world population all basic human needs, but you have to sacrifice a finger every time you make that deal; how many people will you help?2·20 hours agoI also choose some other guy’s fingers.
!$(history | grep <foo> | awk ‘{print $1}’ | tail -n1) || echo ‘bad search, dummy.’
dream_weasel@sh.itjust.worksto Ask Lemmy@lemmy.world•What is really meant by "programming" when people say they like to use linux for it?10·1 day agoI wrote a little bit of code to tell me if or when my electricity would be cheaper if I used on demand pricing instead of flat rate. Basically anything you might use excel for could be a programming problem.
For other hobby projects and “why Linux” it’s easier to sew things together than windows, generally speaking.
Example:
Every time I sit down at my PC the first thing I usually do is open a terminal: it is both my launcher and my file manager. I have several programs with TUI (terminal user interface) or text based API (which is an applied programming interface) and I keep my notes in plain text. One type of note I keep is an “atomic” note inside my zettelkasten (this is a fancy way of keeping track of ideas and the way they connect together, but you need to revisit them for it to be useful. Kinda like anki / spaced reputation I guess).
So enough background, here’s the idea and the programming:
-
If I always open a terminal, it’s a good place to put stuff I want to see.
-
There are two things I want to see: twice a day I want to see a note, the rest of the time I want to see the 3 or 4 most important tasks on my todo list
-
I want randomized notes and I want it to be automatic.
One of the easiest things you can do in a terminal is “echo” text. So I started by, in my terminal “rc” file (the configuration file that tells the terminal what to do when you start it) echoing my todo list as the very last step in the start process. Then it’s refinement. First don’t give me the whole list, use shell tools to show the head of the list. Now make a conditional statement that says “if there’s a file called “temp” in some folder give me the Todo list, otherwise do nothing”. Basically we follow the incremental logic train until you get the final product:
- If no file exists, print a note (at random) and then make the file
- If the file exists write part of the todo list
- Every 6 hours, delete the file automatically with cron
Neat you just programmed a lame, but useful tool.
-
dream_weasel@sh.itjust.worksto Technology@lemmy.world•Facebook Cybertruck Owners Group Copes With Relentless MockeryEnglish1·3 months agoFlipping off*. You can flick off boogers, but you flip the bird.
Hermes, is that you?