I love Homebrew, I really do. But some of the limitations of the system, while understandable from a maintenance point of view, can be really frustrating. In How to Create and Maintain a Taphttps://docs.brew.sh/How-to-Create-and-Maintain-a-Tap the Homebrew team shows how to create a tap and how to add formulae and casks to it. At first, I thought it would be easy; just use brew tap-new to create the custom tap, create the corresponding repository, create the formulas that I want to use, and push them to the repo. But it's not that easy. The post will discuss how to create a...
I've always wanted to do Optical Character Recognition OCR in Node.js but the alternatives always seemed too complicated for simple command line and browser use. Recently I came accross Tesseract.jshttps://tesseract.projectnaptha.com/, a Javascript port of the Tesseract C++ libraryhttps://github.com/tesseract-ocr/tesseract. Tesseract any version will take an image as input and output any text that it finds as part of the image. This post presents an example of how to use Tesseract.js to do OCR. The first step is to install Tesseract.js. bash npm install tesseract.js Next, we need to import the packages we need. There are packages that are native to Node...
There are times when we want to create a hash from either a string or an existing file. This has multiple uses. Some that come to mind are: - Validate the file has not changed. As long as the file remains the same the hash will remain the same too - Use it as a unique identifier for a file by combining the hash with the file name This is different than creating a UUID with Node. The UUID is random and is not tied to the file. The hash is tied to the file and will produce the same...
UUIDs Universally Unique IDentifier are also known as GUIDs Globally Unique IDentifier. A UUID is 128 bits long and can guarantee uniqueness across space and time. UUIDs are defined in RFC 4122https://www.ietf.org/rfc/rfc4122.txt. This post will work in two ways of generating UUID V4 strings: Using the UUID package and the randomUUID method of the native Node Crypto package. The native way Since Node 15.6.0, Node's cryptohttps://nodejs.org/api/crypto.html module provides a method for generating v4 UUIDs. We first import the method from the crypto module. js import { randomUUID } from 'crypto'; We then call the method to generate a UUID using...
It is easy to think of Local by Flywheelhttps://localwp.com/ as just a way to run a WordPress site locally. It is that and it is also much more than that. Review: What is Local by Flywheel? Local by Flywheel Local is a WordPress-specific local development environment. It provides several features that make development easier and faster. Some of these features include: Multiple hosting options Ngnix and Apache servers Multiple versions of PHP 5.6, 7.3, 7.4, and 8.0 and MySQL 5.7 and 8.0 The ability to swap between versions of PHP and MySQL The ability to switch between Nginx and Apache...
As part of creating a writing guide for my content, I've been thinking about how to create a glossary of technical terms that we can expand as we go along. Yahoo! Style Guide provided such a glossary and made it available for download so people could use it as is or use it as a starting point for their own glossaries. The project tries to create a glossary of relevant terms for a technology blog. Some steps leading to this are: 1. Convert the Yahoo Style Guide to JSON to use as the base for the glossary 2. Decide if...
Most current browsers support ESModuleshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules. This is the way the ECMAScript standard defines import modules. However, because it's come late to the party after UMDhttps://github.com/umdjs/umd and CommonJShttps://nodejs.org/api/modules.htmlmodulesmodulescommonjsmodules modules, they are not widely used on client-side code. One of the problems is how to reference the modules we want to import. Import maps are a way to map the names of imported packages to the full path on the filesystem allowing developers to use bare module import. At their simplest, import maps are a list of tuples in the form of : The following example gives Lodash the identified Lodash, like...
A lot of times we need to build a project every time we make changes. I picked my Gulp publishing process to test if Github actions work with this. The idea is that every time we push a commit or we close a Pull Request, Github Actions will run the Gulp default build process from the content in the main branch. See the Github Actions Documentationhttps://docs.github.com/en/actions for more information about the tool, how it works and what you can do with it. The First Try In the first pass, we want to validate that the project is set up correctly...
I've always been interested in web annotations as a means to increase interaction between users and content and between users. Over the time I've been researching the annotation landscape I've found that Hypothesishttps://hypothes.is is my favorite. It also has a WordPress pluginhttps://wordpress.org/plugins/hypothesis/ that integrates personal Hypothesis accounts with whatever sites they visit, not just my WordPress site. This post will discuss web annotations, how they are, and how they work. It will also discuss how to incorporate Hypothesis into a WordPress site using a plugin. What are web annotations? Annotations are an additional layer of information attached to a web...
If you work with web components, one of the pain points is how to add styles to multiple copies of the same component. None of the existing solutions work well and all have one or more rough edges. See the CSS Modules Scripts Chrome Status Entryhttps://chromestatus.com/feature/5948572598009856 for an explanation of the rough edges as seen by the team implementing the feature. CSS Module Scriptshttps://web.dev/css-module-scripts/ CSS Modules for short allows you to import an external stylesheet and attach it to multiple documents and components. js import sheet from './index.css' assert { type: 'css' }; document.adoptedStyleSheets = ...document.adoptedStyleSheets, sheet; // Attach to...