What I Learned Today (9th of February, 2023)

Regex Started doing regex exercises, so i don’t get bored doing only python. will alternate them for now Using Practice Makes Regexp. I have only the book though. It’s now expanded to include video solutions too. Highly recommend any of Reuven’s courses Set up environment and did one exercise which was to look up the user’s input in a dictionary (a word dictionary. not a programming dictionary) Linux Mint Yesterday’s work was for naught Devops Kubernetes, began doing some exercises Set up the environment today Spoke with a friend about practicing Ansible / Devops stuff Learnt about putting in environment variables into a docker compose file and then using them in a Django container Hugo Diddled with the code element font size on the blog, to make it look a little larger Urdu Learnt about the “tashdiid” symbol that helps add emphasis to a consonant Physical Fitness Nearing the end of my month long journey. Have gotten over the pain hump, but the personal trainer isn’t quite sympatico with my needs. He’s a good egg, but we seem to be talking past each other. Wonder what to do when my time is up mid week next. Did legs today. Went well. Jogged 10m after. Walked 30m after that. Feedback on this post? Mail me at feedback@janusworx.com P.S. Subscribe to my mailing list! Forward these posts and letters to your friends and get them to subscribe! P.P.S. Feed my insatiable reading habit. ...

February 9, 2023 · Mario Jason Braganza

What I Learned Today (8th of February, 2023)

Don’t know if it’s the gym or the regular work beat, but I seem to be waking up later and later everyday. I don’t know what to do about this. I feel a little anxious about not having enough hours in the day. Python Why use comprehensions? Because it reads better. Like I advice the young ones in DPGLUG on writing. Write short, choppy sentences. They read better. With my problem sets … I should stop trying to generalise in advance and solve the specific problem first. Read stuff carefully. Don’t do more than is necessary Solutions take time to understand too. Budget the time Linux Mint Nemo, the file browser in Linux Mint always opens the home directory, when I click on it and there’s no apparent way to change it to a preferred directory. I want it to always open Downloads A little bit of web spelunking led to an acceptable work-around. Right click the main menu button Click Menu => Open the menu editor => Accessories Then click Files in the items from the right and click Properties further right Change the command form nemo %U to nemo Downloads And that does it! Update 2023-02-09: Does not work. Will look for some other approach. Right now, with the workaround it opens a Downloads window alongside any other folder I click on 😂 Hugo Added a plain, hamburger menu to this blog, using Aditya’s helpful instructions over on the PaperMod Discord. With all the extra nav items, I’ve added to the header the menu would overflow on my iPhone (and probably on other folks’ phones too). So if this page scooches narrow enough, it will change the links on top to a plain menu. ...

February 8, 2023 · Mario Jason Braganza

What I Learned Today (6th of February, 2023)

Everything went to hell in a handbasket today. Time was short. I got up late. I forgot, I had physio. So most things got slightly abbreviated or dropped. Python Did not complete my assignment. Flunked it again. But on the plus side, those 45 minutes were some of the hardest thinking and iterating, I have done in weeks. So there’s that. And on the plusser1 side, I am proud of having stopped and then looked for help. That was my biggest learning for the day. ...

February 6, 2023 · Mario Jason Braganza

Notes to Self, on Self Hosting Fonts on My Hugo Blog

Writing this down, so that I will not struggle the next time1, I have to do this. I use Valkyrie for everything on the blog in various weights, except for code and preformatted stuff, which uses Source Code Pro Medium. Both are WOFF2 fonts. Anything in Hugo’s assets/css/extended folder will be picked up by Hugo and bundled into a single CSS file. The fonts are in subdirectories in the static/fonts/font-name folder. Anything in the static folder shows up at the root of the site. ~/mjb/blog/static/images/test.jpg will become /images/test.jpg I’ve created an embed-font-name.css file in the css folder above, with embed instructions generously provided by Matthew Butterick in his font documentation for Valkyrie. I adapted the same for Source Code Pro as well. Here’s a sample of my embed-source-code-pro.css 1 2 3 4 5 6 7 8 @font-face { font-family: 'Source Code Pro Medium'; font-style: normal; font-weight: medium; font-stretch: normal; font-display: auto; src: url('/fonts/source-code-pro/SourceCodePro-Medium.woff2') format('woff2'); } Finally, I created a zz-include-css.css file, which I use to overide the default CSS, so I can use my custom fonts. Since it starts with a zz it comes after the files above, that start with embed, in the final munged and minified CSS file. These are my instructions to have most text rendered with Valkyrie and code as Source Code Pro Medium2 1 2 3 4 5 6 7 8 9 10 #top { font-family: valkyrie; font-variant: oldstyle-nums; } .post-content pre, code { font-family: 'Source Code Pro Medium'; font-style: medium; font-weight: 500; } Look! So pretty :) P.S. Subscribe to my mailing list! Forward these posts and letters to your friends and get them to subscribe! P.P.S. Feed my insatiable reading habit. ...

October 9, 2022 · Mario Jason Braganza

Line Numbers in Hugo Codeblocks

I want my code blocks on the blog to sometimes have line numbers. Looking at the Hugo docs here and here led me to the linenos argument. While we’d start our code blocks like (```python)1, all I need more is to add the line number argument like so. Vanilla code block … print(f""" “It’s silly to try to escape other people’s faults. They are inescapable. Just try to escape your own.” — Marcus Aurelius """) print(f""" “Just that you do the right thing. The rest doesn’t matter.” – Marcus Aurelius """) Now, using the linenos option, I can be all fancy to show … ...

September 17, 2022 · Mario Jason Braganza

Drafts App Needs Escaping if I Am to Use Hugo Shortcodes

When I finally figured out how to get line breaks working on my microblog, I ran into another sort of hiccough, when I tried doing that from my phone. I use the Drafts app on my phone and tablet to slice and dice all manner of text and to send it to various locations as I please. One of those is a workflow, that lets me shoot text to a folder on my server which is then published (via a script) on the microblog. And everytime I typed my {{< hbr >}} Hugo shortcode to let me have a line break in that post1, it would just publish gibberish2 instead of giving me said break. ...

September 14, 2022 · Mario Jason Braganza