serhii.net

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

28 Sep 2021

Day 1001

1001th post in Hugo!

Set up Hugo for DTB and partly sth I’ll call NTB, which is non-work stuff.

So far Hugo is 110/10.

Old one for now is here.

Jekyll to Hugo

TODO:

  • Aliases/redirects from old posts to new ones (serhii.net/day123.html -> serhii.net/day123)
    • uglyurls: true in config does exactly this!
    • …but breaks lists/indexes somehow :(
  • Look through master file for formatting issues
  • Better black-background syntax highlighting if no language specified
    • Ideally make them indistinguishable from styled ones
    • And remove ghost ones like day 996
      • The problem was with my markdown syntax, apparently *I need a two space indentation from the * for it to be parsed correctly. Another reason to revisit my vim tab settings?
    • using '''text seems like a workaround:
      This is text
      No syntax highlighting
      
      And:
      This is text
      No syntax highlighting _at all_
      
  • Randomized footers
  • Set up Atom feed on home page
    • Or actually - I could move the entire website to Hugo, and have the index-index as a template and /dtb for the posts stuff?
  • Strikethrough
    • Markdown strikethrough is ~~strikethrough~~ 1
  • Fix code listings’ width influencing the width of entire Day.

tree including hidden files

I love how intuitive it is - needed a dotfile in tree, tried tree -a, it worked.

Python unittest

setUp() and tearDown() methods in unittests get executed before/after each test method!

Unregistering Detectron2 datasets for unittests

The dictionary with the datasets is a global dictionary, which means that you can’t register_coco_instances() in separate unittests in the same file!

This worked:

if Constants.TRAIN_DATASET_NAME in MetadataCatalog.data:
    MetadataCatalog.remove(Constants.TRAIN_DATASET_NAME)
    MetadataCatalog.remove(Constants.TEST_DATASET_NAME)
    DatasetCatalog.remove(Constants.TRAIN_DATASET_NAME)
    DatasetCatalog.remove(Constants.TEST_DATASET_NAME)

Pycharm / Intellij idea visual guides for character limit

Through IDE settings one can configure whether one or multiple visual guides are shown, and the actual number of characters is configured through Settings -> Code Style.

Random

Jupyter notebooks + RISE + Reveal.js + a makefile: cornell-cs5785-2021-applied-ml/Makefile at main · kuleshov/cornell-cs5785-2021-applied-ml

TODO - Git - squashing multiple commits into one

Squash commits into one with Git - Internal Pointers (link by SO):

# Merge the last 7 commits into one
git rebase --interactive HEAD~[7]
# Merge the commits from that commit hash
git rebase --interactive 6394dc

In the latest one, the commit hash is “the hash of the commit just before the first one you want to rewrite from.”

Practically, assuming I want to squash together the a ones, I’d do git rebase --interactive B as it’s the one immediately following the ones I need.

commit a1 (latest/newest)
commit a2
commit a3
commit B
commit C

When actually doing the squashing, set squash in front of the commit lines to squash. In the next screen, leave only the commit message(s) needed.

I love how it uses vim for this! Very interesting way to do an interface.

Nel mezzo del deserto posso dire tutto quello che voglio.