Skip to content

Instantly share code, notes, and snippets.

View jbenner-radham's full-sized avatar

James Benner jbenner-radham

View GitHub Profile
# EZA Theme: ~/.config/eza/theme.yml
# Powershell:
# Set-Item -Path Env:\EZA_CONFIG_DIR C:\Users\wyatt\.config\eza
colourful: true
filekinds:
normal: { foreground: "#ABB2BF" }
directory: { foreground: "#61AFEF" }
symlink: { foreground: "#56B6C2" }
@amitmerchant1990
amitmerchant1990 / console.js
Created January 24, 2025 08:07
Calculate used localStorage size for a website
let totalSize = 0;
for (let key in localStorage) {
if (localStorage.hasOwnProperty(key)) {
let keySize = new Blob([key]).size; // Size of the key
let valueSize = new Blob([localStorage[key]]).size; // Size of the value
totalSize += keySize + valueSize;
}
}
@kesor
kesor / eza-wrapper.sh
Last active July 9, 2025 10:14
Wrapper around `eza` to make it have `ls`-like arguments, especially `-t`
#!/bin/bash
# CHANGE THIS
ACTUAL_EZA=/usr/local/bin/_eza
display_time="modified"
sort_time=""
args=()
while [ "$#" -gt 0 ]; do
@khalidx
khalidx / node-typescript-esm.md
Last active July 9, 2025 15:12
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@NorbiPeti
NorbiPeti / IntelliJFlatpak.md
Last active June 3, 2025 15:28
IntelliJ IDEA Flatpak Setup Guide

IntelliJ IDEA Flatpak Setup Guide

In this guide I collect all the things I had to manually set up after installing IntelliJ using Flatpak on Linux. Also mostly applicable to other JetBrains IDEs like PHPStorm, WebStorm, Rider, PyCharm etc.

Java versions

Flatpak uses an isolated environment to install the latest version of (usually graphical) applications without having to rely on installed system libraries and such with varying versions.

@Myndex
Myndex / GitHubFlavoredMarkdown.md
Last active July 12, 2025 10:12 — forked from joshuapekera/markdown
GitHub Flavored Markdown Cheat Sheet
@sts10
sts10 / rust-command-line-utilities.markdown
Last active July 17, 2025 02:30
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@sindresorhus
sindresorhus / esm-package.md
Last active July 14, 2025 05:53
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}