Posts

forgit - Git with fzf

Fuzzy Finder for Git Commands

The real time fuzzy finder tool fzf is a good tool to perform searches for files as well as filtering output from other command line tools. This tool complements Git really well due to the fact git has a master-detail workflow view. When you are looking at a commit log (master), you want to look at the file changes (details) for that commit.

Categories: #git #shell
Docusaurus - Basic Config

Documentation-centric Changes

Docusaurus is a JavaScript framework documentation generator. This tool provides many useful conveniences such as documentation versioning and search integration. Docusaurus gives you the ability to quickly get a working documentation site running by using a config-based means of manipulating your settings for the site. Even though it is config-based, one can drop to a lower level by changing JavaScript and styles files in the src source to make custom changes to your site.

Categories: #JavaScript #documentation
Using Ava with Testdouble

Example of a Simple Test Case

Ava is a unique testing framework in that it is one of the few testing frameworks out there that recognizes observable resolution. It also makes asynchronous testing the default option when you write tests ensuring better performance. Another nice feature of Ava is that it has a nicer assertion output display.

Testdouble is an assertion library which specializes in create 'doubles'. Testdouble is different from Sinon because Testdouble will replace the function outright for which it is substituting when mocking out a function or object. It also makes it easier to track using a 'sandbox' API to alleviate the user from having to restore an original replaced function.

Categories: #JavaScript #testing
Tags: #NodeJs
JavaScript - Querying Objects

Data Querying

As JSON/JavaScript objects are heavily relied upon means of accessing data, it is crucial to quickly retrieve certain pieces of information within the object quickly. For simple objects, a couple of loops will suffice in honing in to the exact detail, but most likely, the general object will be more complex.

Categories: #JavaScript
Zola - Include Template

Common Template

Common content that belongs on multiple pages should be situated in a template which should be shared globally. An example of would be a footer, the bottom of the page content that persists across pages. Looking at Tera, the template engine for Zola, the include feature within a template offers the capability to reference other templates.

Categories: #cms
Visual Studio Code Extensions - Quick Picks #6

Markdown Table Formatter

A markdown table's formatting often tends to go awry when there is a need to change the words in the headers which affects the width of columns. It is a laborious process to have to realign all the column content that fall underneath the changed header.

To solve this issue, use the Markdown Table Formatter extension to format markdown tables. This extension will format the 'basic markdown tables' such as the following:

| Food Item  | Items Bought |
|------------|--------------|
| Pineapples | 4            |
| Tomatoes   | 3            |

However, it does not work with Pandoc's grid table markdown output.

Categories: #editor