๐จ๐ฝโ๐ป What Type of Code Did I Write This Week?
From: 14 August 2024 - To: 21 August 2024
Python 5 hrs 35 mins โโโโโโโโโโโโโโโโโโโโโโโโโ 76.85 %
Svelte 41 mins โโโโโโโโโโโโโโโโโโโโโโโโโ 09.46 %
JavaScript 16 mins โโโโโโโโโโโโโโโโโโโโโโโโโ 03.72 %
Bash 8 mins โโโโโโโโโโโโโโโโโโโโโโโโโ 01.96 %
Text 8 mins โโโโโโโโโโโโโโโโโโโโโโโโโ 01.84 %
Coding metrics are powered by Wakatime
-
Add Search to Your Static Site with Lunr.js (Hugo, Vanilla JS) Jun 30 2020 โ I decided to document how I implemented a search feature with Hugo and Lunr.js on my personal blog site. Since this is a static site the search functionality is performed entirely within the client's browser. My solution uses vanilla JS DOM manipulation to render the search results. I believe that my approach includes features that are markedly different from the implementations I encountered while researching this task, features which enhance the overall search UX.
-
An Introduction to Decorators in Python Feb 27 2020 โ Decorators can be a daunting topic when first encountered. While the Zen of Python states "There should be one-- and preferably only one --obvious way to do it", there are many, equally valid ways to implement the same decorator. These different methods can be categorized as either function-based, class-based, or a hybrid of both. In this post I will explain the design and behavior of Python decorators and provide examples of decorators that I frequently use in my own code.
-
Hugo: Add Copy-to-Clipboard Button to Code Blocks with Vanilla JS Nov 13 2019 โ Hugo includes a built-in syntax-highlighter called Chroma. Chroma is extremely fast since it is written in pure Go (like Hugo) and supports every language I can think of. Chroma's speed is especially important since syntax highlighters are notorious for causing slow page loads. However, it lacks one vital feature โ an easy way to copy a code block to the clipboard. I decided to document my implementation using only vanilla JS since every blog post I found for this issue relied on jquery to parse the DOM, which is completely unnecessary at this point.