Posts

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
Vite - Quick Tips #1

More Log Information when Vite Server Runs

Using the -d option with the Vite command in the npm script to have more verbose output for debugging.

// ...
    "scripts": {
        "dev": "vite -d",
        "build": "vite build",
        "preview": "vite preview"
    }
// ...
Categories: #Tooling #javascript
Tags: #frontend
Git - Custom SSH Keys Per Repository

Assign Git Profiles for Different Repositories

On occasions where you wish to associate different Git profiles to different repositories, such as when you have a work account and a personal account, one can achieve this by running a Git config command on repository level basis.

Categories: #git