Skip to content

Instantly share code, notes, and snippets.

View elcharitas's full-sized avatar
🦀
writing some sick apps from home

Jonathan Irhodia elcharitas

🦀
writing some sick apps from home
View GitHub Profile
@elcharitas
elcharitas / local-dev.sh
Created February 21, 2024 08:08
Generate Local SSL cert and Host file on macOS
#!/bin/bash
# This script generates a self-signed certificate for a local development server on macOS
# It is inspired by https://github.com/matt-goldman/local-signin-with-apple for windows powershell
# Default URL and certificate password
url="local-dev.com"
certPassword=""
# Check for root privileges

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@elcharitas
elcharitas / convert.js
Created April 30, 2022 09:44
Safely Convert Ethereum BigNumber to and from JavaScript Number with Units
import { utils } from "ethers";
export function convert(value, unit = "ether") {
if (value instanceof ethers.BigNumber) {
return utils.formatUnits(value.toString(), unit);
} else {
return ethers.BigNumber.from(value);
}
}