Skip to Content
Development

Development

All about programming, documentation, testing, deploying, environment setups, and so on.

9 posts

Posts tagged with Development

My switch to Omarchy

Why and how I switched my personal PC from Windows to Linux using Omarchy.

A screenshot from my fresh Omarchy install.

My personal Windows PC has primarily been used for the browser, VS Code for some light development, and a couple of games. When I decided to try to set up Ghost locally for theme development, I was immediately reminded of why I prefer not to do development on Windows.

Trying to set up Ghost on Windows led me down a rabbit hole of installing and uninstalling various libraries and software packages I had never heard of, and repeatedly rebooting my computer. All without success.

All the documentation and discussions I read made it clear that Linux or Mac was the

My switch to Omarchy Read more

Auto Dark Mode with CSS

How to automatically switch between light and dark themes in your CSS based on the visitors system settings.

If you want your site to automatically switch between light and dark themes based on the visitor's system settings, you can use a @media query and the prefers-color-scheme feature.

css:root {
    --color-background: #eee;
    --color-text: #000;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #333;
        --color-text: #eee;
    }
}

body {
    color: var(--color-text);
    background-color: var(--color-background);
}
Auto Dark Mode with CSS Read more

Installing Linux onto Windows with WSL

Steps for installing WSL, installing Linux, uninstalling Linux, and looking at your versions.

I’m starting to play around with other developer languages, like Ruby, and wanted to set up a development environment on my  Windows machine, which I typically only use for gaming. The first step was to set up WSL (Windows Subsystem for Linux) which allows me to run Linux CLI on Windows. 

WSL

WSL (Windows Subsystem for Linux) allows you to run Linux directly on your Windows machine. This is useful for development, for example, when you need to use Linux but don’t want to switch to a separate Linux machine or VM.

Installing WSL

To install

Installing Linux onto Windows with WSL Read more

Hide an email address on your webpage with JavaScript

Using some simple HTML, you can obfuscate an email address (or any other text) from a link on a web page. But when clicked, it will still work! It uses HTML data attributes to allow you to create your email address broken and then combine the pieces together when the user clicks the link. This should hide the email from unwanted visitors and bots.

<a href=“#” 
   data-name=“name”
   data-domain=“yourdomain” 
   data-tld=“com”
   onclick=“window.location.href = ‘mailto:’ + this.dataset.name + ‘@‘ + this.dataset.domain + ‘.’ + this.dataset.tld; return false;”>Text</a>

I found this trick from this&

Hide an email address on your webpage with JavaScript Read more

Add Tinylytics script to Obsidian Publish

If you use Obsidian Publish to host your Digital Garden and want a simple and privacy-focused analytics solution to track how people view your site, then this is for you. Tinylytics is a privacy-focused and straightforward analytics service.

  1. Create a file named publish.js in your root directory.
  2. Add the following script to the file.
  3. Update the script with your Tinylytics embed code.
  4. Publish the file!
var tinylyticsScript = document.createElement('script'); 
tinylyticsScript.defer = true; 
tinylyticsScript.src = '[tinylytics.app/embed/YOU...](https://tinylytics.app/embed/YOUREMBEDCODE.js';) document.head.appendChild(tinylyticsScript);
Add Tinylytics script to Obsidian Publish Read more

NVM

As developers who rely on NodeJS, we often encounter applications that require different versions of Node to run. This is where NVM (Node Version Manager) comes in. NVM makes it easy to install multiple versions of Node.js on your machine and switch between them as needed.

Installing NVM on Mac

  • Open your terminal.
  • Run brew install NVM.

Installing NVM on Windows

  • Download and install the latest release of nvm-windows.

Using NVM

  • nvm --help Find all of the options available.
  • nvm install [Version] Installs the given version.
  • nvm current Shows the current version.
  • nvm use [Version]
NVM Read more