Skip to content

Instantly share code, notes, and snippets.

View tlhunter's full-sized avatar
📸
photographing

Thomas Hunter II tlhunter

📸
photographing
View GitHub Profile
@tlhunter
tlhunter / linux-desktop-install.sh
Created April 10, 2018 19:27
For my Openbox setup. Needs manual intervention everywhere
sudo apt install leafpad htop \
openbox menu openbox-menu tint2 \
obconf lxappearance scrot \
terminator git stterm arandr \
build-essential curl dia dmenu etherape \
filezilla gimp gparted hexcurse \
inkscape nmap tig tmux transmission-gtk \
vim-gtk vlc wireshark zsh keepassx snapd \
feh galculator kazam xbacklight
@tlhunter
tlhunter / embed.js
Last active November 3, 2018 05:56
Replace GitHub Gist's, YouTube, Vimeo URLs with their embed equivalent
/**
* This function accepts text which is to be transformed into HTML. When
* it encounteres a line which simply contains a single URL it will replace
* that URL with an HTML tag to embed the corresponding resource.
*
* Supported services:
* - GitHub Gists
* - YouTube Videos
* - Vimeo Videos
*/
@tlhunter
tlhunter / node-cluster.js
Created July 19, 2019 23:36
Just the basic node cluster example
const cluster = require('cluster');
const http = require('http');
const numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
console.log(`Master ${process.pid} is running`);
// Fork workers.
for (let i = 0; i < numCPUs; i++) {
cluster.fork();
@tlhunter
tlhunter / delete-raw-files.mjs
Created January 21, 2024 22:21
Script to help delete unwanted RAW files with a Darktable workflow
#!/usr/bin/env zx
/**
* `npm install -g zx`
*
* I take photos on a Sony camera in RAW+JPG mode.
* I then scroll through all the photos in Darktable usually at least once.
* When I really like a photo I export it as DSC001.export.jpg or DSC001.insta.jpg.
* Sometimes I rate photos in Darktable but not always.
*
#!/usr/bin/env node
// this script looks through chase credit card transactions looking for repeat description/amount combinations
// login to Chase, click credit card, set a time range, click download account activity (down arrow), choose CSV
// usage: node ./chase-subscription-finder.js Chase*Activity*.CSV
const fs = require('fs');
const BLACKLIST = [
'PEETZ', // coffee