Free Software and Programming Leftovers: Mastodon, Emacs, and Python
-
Migrating Mastodon lists
My original Mastodon account was on mastodon.social. I chose it because it's the largest instance, it's operated by the developers of the service, and it runs the reference implementation of the software.
-
Compiling Emacs
Compiling Emacs
Quite some time ago I started with a git clone of the Emacs sources and compiled that.
From that time on, on a regular basis I do a git pull and recompile Emacs.
Like all self compiled software, I manage the installation with GNU Stow.
Being Emacs, there is probably more than one way to compile it, and I don't know if the way I compile Emacs is the best way, but it works and has never failed.
Before you start, make sure you have the right dependencies installed. The (not very big) list of packages to install is, of course, for every operating system different.
-
Org-capture template for weeknotes
Org-capture template for weeknotes
Today I created a small template for org capture, to create weeknotes.
This is the template:
* Week %(format-time-string "%Y-%W") ** %? *** Reading *** Things I have learned *** Events Entered on %U ;; Weeknote ends here
This will create a note starting with the header
* Week 2023-15
for week 15 in the year 2023.
-
Length of Dictionary Python
The len() method can be used to find the length of a Python Dictionary. This len() method works for nested Dictionaries as well.
-
How to Remove an Element From a Set in Python
To remove an element(s) from a set in Python, use the remove() method, the discard() method, the difference() method, or the subtraction operator.
-
How to Instantiate a Class in Python
To instantiate a class in Python, simply create a variable and set it equal to a call to the class name with parenthesis, similar to calling a function.
-
Remove None from the List Python
To remove all None values, use the remove() with __contains__(), list comprehension with if condition, or the filter() method with Lambda statement.
-
Python Object to String
To convert Python Objects into Python string, the user can make use of the str() constructor method and the repr() method.