Scope: This project focuses purely on JavaScript and, sure, Typescript 😎 but the same patterns could be applied to other languages and/or systems.
Dependabot is great! Why did I learn how I could replace it?
The following file(s) aim to display a pattern of node script development.
In this pattern the CLI program is built to execute the standalone node script.
After using terminals (iTerm, Terminal, Kitty) with an M1 Mac without issue for over a year, I finally came upon an issue that I couldn’t solve without using Rosetta. Rosetta is Mac software to run Intel Mac terminal commands on an M1 Mac. My issue initially came from trying to use Pyenv to install and use different versions of Python across multiple projects. After installing Rosetta, I initially used it by adding a custom flag to commands like this arch -x86_64
. This worked for me but was really error prone, “Did I forget the flag? Did I add the flag in the correct place?”.
This document describes solving M1 Mac vs Intel Mac terminal command discrepancies by creating a copy of your terminal and setting it up to run Intel Mac terminal commands using Rosetta. Although the process of making a Rosetta termi
import loadImage from 'loadImage' | |
const addImg = (src) => { | |
const imgEl = document.createElement('img') | |
imgEl.src = src | |
document.body.appendChild(imgEl) | |
} | |
const imgArr = [ | |
loadImage('images/cat1.jpg'), | |
loadImage('images/cat2.jpg'), |
/* | |
ES5/6 Observer 👀 | |
--- | |
- Like a promise (sort of) but will work in older browsers | |
- With Babel, this will transpile to something very similar to want is written | |
- Note the error | |
- both callback, err will return empty strings by default | |
- bool is false by default | |
*/ | |
const observer = (bool = false, callback = () => '', iterator = 10, maxTime = 300, err = () => '') => { |
<!-- android --> | |
<link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png"> | |
<link rel="icon" type="image/png" sizes="512x512" href="/android-chrome-512x512.png"> | |
<!-- apple --> | |
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> | |
<!-- favicon --> | |
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> | |
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> | |
<!-- manifest --> | |
<link rel="manifest" href="/manifest.json"> |