Skip to content

Instantly share code, notes, and snippets.

View jwmann's full-sized avatar
🎯
Focusing

James W Mann jwmann

🎯
Focusing
View GitHub Profile
@t3dotgg
t3dotgg / try-catch.ts
Last active July 12, 2025 16:28
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@NorkzYT
NorkzYT / README.md
Last active July 8, 2025 02:58
Proxmox CIFS Share Mount Wizard Script

Proxmox LXC ⇆ CIFS Mount Wizard

proxmox-lxc-cifs-share.sh is an interactive helper that mounts a network CIFS/SMB share on a Proxmox VE node and bind-mounts it into one or more unprivileged LXC containers in one pass.
It automates:

  1. Creating a host-side mountpoint under /mnt/lxc_shares/<folder>.
  2. Writing a properly-tuned /etc/fstab entry (systemd.automount, uid/gid mapping, etc.).
  3. Mounting the share immediately.
  4. Injecting the bind-mount (mpX:) into the live LXC configuration with pct set.
  5. Stopping and restarting each container to apply the mount.
@samwiseg0
samwiseg0 / ss_ps_fil_to_orca_fil.py
Last active January 18, 2025 21:57
Convert SuperSlicer/PrusaSlicer filament profiles to OrcaSlicer
# -*- coding: utf-8 -*-
import argparse
import configparser
import json
import os
def sanitize_value(value):
# Remove leading and trailing whitespaces, including newline characters
value = value.strip()
# Remove any extra quotes or escape characters
@Fanman03
Fanman03 / UAP-Guide.md
Last active July 12, 2025 04:19
UniFi AP Buyers Guide

UniFi AP Buyers Guide

(updated May 2025)

The APs in this list are ordered from highest to lowest performance. However, unless you have a very high number of devices you likely do NOT need to buy the most expensive, highest performance AP. You can also check Ebay for deals, especially on older equipment.

All APs in this list support both wired backhaul and mesh modes. However, wired connections are strongly recommended for better performance and reliability.

Number of spatial streams are listed in order of 2.4GHz, 5GHz, 6GHz.

Good Choices:

@nivrith
nivrith / prepare-commit-msg.sh
Last active October 11, 2024 18:49 — forked from johncmunson/prepare-commit-msg.sh
prepare-commit-message.sh
#!/bin/sh
#
# Inspects branch name and checks if it contains a Jira ticket number (i.e. ABC-123).
# If yes, commit message will be automatically prepended with [ABC-123].
#
# Useful for looking through git history and relating a commit or group of commits
# back to a user story.
#
@wosephjeber
wosephjeber / git_revision.js
Last active December 16, 2024 16:28
Get branch and commit names from Node (synchronously)
const { execSync } = require('child_process');
function executeGitCommand(command) {
return execSync(command)
.toString('utf8')
.replace(/[\n\r\s]+$/, '');
}
const BRANCH = executeGitCommand('git rev-parse --abbrev-ref HEAD');
const COMMIT_SHA = executeGitCommand('git rev-parse HEAD');
@adisib
adisib / youtube_hd.user.js
Last active June 26, 2025 18:24
Make youtube videos in HD and automatically resize
// ==UserScript==
// @name Youtube HD
// @author adisib
// @namespace namespace_adisib
// @description Select a youtube resolution and resize the player.
// @version 2025.04.13
// @match https://*.youtube.com/*
// @noframes
// @grant GM.getValue
// @grant GM.setValue
@vannmangel
vannmangel / Remove-SkypeAds.ps1
Last active March 21, 2025 22:07
Remove ads in skype
# start as admin!
# prompt for username
$SkypeUserName = Read-Host -Prompt "What is your Skype username?"
# stop skype-process
try{
if(Get-Process | ? {$_.Name -like 'skype'}) {Stop-Process -Name skype}
# commit changes to hosts file
$hostfile = "C:\Windows\System32\Drivers\etc\hosts"
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@andrewroberts
andrewroberts / Log.gs
Last active January 4, 2020 14:32
A simple wrapper for the BetterLog Google Apps Script Library - GAS Library MqTFuiXcPtS5rVUZ_jC9Z4tnfWGfgtIUb
// 34567890123456789012345678901234567890123456789012345678901234567890123456789
// JSHint: 22 March 2015 08:56 GMT
// Unit Tests: 22 March 2015 08:50 GMT
/*
* Copyright (C) 2015-2017 Andrew Roberts ([email protected])
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software