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

Line Breaks on My Microblog

I use a (not quite) hidden blog to collect all sorts of bits and bobs and to (selectively and automatically) publish them to my fediverse or twitter accounts. The one thing that constantly bugged me, was that it would not accept line breaks to differentiate between paragraphs. Like this post, here. I don’t know if it’s my theme or a Hugo thing. And try as I might, I couldn’t quite figure it out. Since I don’t quite have the time to dig into the code, I just decided to add a couple of <br> tags. And that did the trick! 1 ...

August 31, 2022 · Mario Jason Braganza

Moving Tasks Between Org Files in Emacs

More diving into Org Mode and Emacs. I have a stuff-to-do.org file, that serves as an inbox for most long term tasks that I want to tackle. Stuff that needs doing, books that I want to buy, books that I want to read, courses that I want to learn, movies or tv shows that I want to watch, stuff on the web that I want to catchup on, etc. etc. etc. ...

August 23, 2022 · Mario Jason Braganza

Notes to Self on Renewing Wildcard Certbot Certs

(Update, 2024-03-15: I now use lego. will update this post later.) After struggling to renew my certs for the third time in a row, hopefully these pointers should keep me on track for the next time. Namecheap does not yet support automatic wildcard renewal for the Letsencrypt/Certbot combo. Check next year. Have your Namecheap control panel open and ready. Switch to root or run the command below with sudo Command to renew: certbot certonly --manual --manual-public-ip-logging-ok --preferred-challenges dns-01 -d *.domain.com -d domain.com certbot will then, print a couple of lines that you need to add as a TXT record in the Namecheap DNS control panel. When you do that, make sure you set the TTL of the record, to a minute, so that you can redo stuff quicker, if you mess up. certbot might ask you to do multiple records. Read the instructions carefully. When you check to see if the TXT record is set, search for the whole domain name. For e.g. _acme-challenge.domain.blah instead of just domain.blah If you’ve done all of the above, hopefully things should go smoothly and the certificate should renew. Restart Nginx and you’re done. If you have multiple machines, figure out a way to securely transfer the certs there too. 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.

August 20, 2022 · Mario Jason Braganza

Splitting an Unwieldy Emacs `init.el`

I started with a very simple init.el when I started using Emacs. Rather than learning it in a structured manner, I just decided to jump in at whatever end of the pool and figure it out as I go. I may not know Emacs, but I do know what I want out of a general purpose text editor. And bending Emacs to do my will, to do what I want it to do or behave in the manner I want it to behave. And Emacs to my eternal gratitude, is flexible to do all I want, thanks to the last forty six years worth of hard work and ideas of people from all over. ...

August 13, 2022 · Mario Jason Braganza

Learning DSA, Day 001: Recursion Basics

Using Abdul Bari’s, Mastering Data Structures & Algorithms using C and C++ to grok the basics. Now that I grok programming, understanding DSA should help me write and think better. And writing rough notes or thoughts to myself here, keeps me accountable and on track.1 Today’s topic? The Basics of Recursion Types of Recursion Tail Recursion Head Recursion Tree Recursion Indirect Recursion Nested Recursion Tail Recursion When a recursive call, is the last statement in a recursive function, that’s tail recursion func(n) { if (n>0) { blah … ; blah … ; blah … ; func(n-1); } } All the operations in the examples above happen at call time. Not when the function returns Tail Recursion vs Loops Tail recursion function can be written as a loop and vice versa Time taken by both, O(n) But the space taken by a loop is O(1) while a tail recursive function is O(n). The loop takes less space. Some compilers also do this under the hood (convert a tail recursive function into a loop) Head Recursion func(n) { if (n>0) { func(n-1); blah … ; blah … ; blah … ; } } In the example above, the recursion happens before anything else takes place. the recursion call is the first statement the rest of the function is processed, in the return process. (i.e. once the recursion call is done executing) Head Recursion vs Loops Head recursion function and a loop that gives a corresponding output are not quiet convertible from one to the other. Some work required. Tree Recursion func(n) { if (n>0) { blah … ; func(n-1); blah … ; func(n-1); blah … ; } } If a function calls itself multiple times, then we have ourselves a tree recursion Time complexity? pretty complex. A simple thing like the one above would be O(2n), while the space complexity is O(n) Indirect Recursion void A (int n) { if (something-something) { blah … ; B(n-1); } } void B (int n) { if (something-something) { blah … ; a(n-1); } } Two (or more) functions calling each other in a circular fashion. A -> B -> C -> A Nested Recursion void fun(int n) { if (blah-something) { blah fun(fun(n-1)) } } A recursive function passes a recursive call to itself as a parameter to the function. 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. ...

August 8, 2022 · Mario Jason Braganza