serhii.net

In the middle of the desert you can say anything you want

14 Feb 2019

Day 045: Finishing moving Wordpress to Jekyll

Cooking

As I was looking for ideas for small businesses, I found this nice website with small easy microwave recipes: https://www.minmaxmeals.com/recipes/garlic-oatmeal/, and I’ll try today the linked one. In general having such a database of go-to dishes would be quite nice, because I forget about mine often.

Jekyll

Categories

For categories, I again used this nice tutorial.

Excerpt separator

When outputting posts, {%raw%}{{post.excerpt}}{%endraw%} either takes the first paragraph or a separator. The separator can be set in config.yml: `excerpt_separator:

`

Posts visibility

published: false in the front matter. I like this more than the official draft mechanism.

Vim

Deleting tags surrounding something

A really elegant way to delete the tags surrounding something: yitvatp

Tag blocks                      *tag-blocks*

For the "it" and "at" text objects an attempt is done to select blocks between
matching tags for HTML and XML.  But since these are not completely compatible
there are a few restrictions.

The normal method is to select a  until the matching .  For "at"
the tags are included, for "it" they are excluded.  But when "it" is repeated
the tags will be included (otherwise nothing would change).  Also, "it" used
on a tag block with no contents will select the leading tag.

Repeat the last used macro

Just discovered this randomly after a typo. @@ repeats the last @-macro I used. This will save me really a lot of time!

Python forcing named arguments in function

In this article, this nice way has been mentioned: def safe_division(*, number, divisor, ignore_overflow, ignore_zero_division): It forces all arguments after * to be named during call: >>> safe_division(number=10**1000, divisor=3**-100, ignore_overflow=True, ignore_zero_division=False)

Stack

Nel mezzo del deserto posso dire tutto quello che voglio.