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 April 26, 2025 18:55
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 / proxmox-lxc-cifs-share.sh
Last active April 27, 2025 00:20
Proxmox CIFS Share Mount Wizard Script
#!/bin/bash
# This script is designed to assist in mounting CIFS/SMB shares to a Proxmox LXC container.
# It automates the process of creating a mount point on the Proxmox VE (PVE) host, adding the
# CIFS share to the /etc/fstab for persistent mounts, and configuring the LXC container to
# recognize the share. This script is intended for use on a Proxmox Virtual Environment and
# requires an LXC container to be specified that will access the mounted share.
#
# Prerequisites:
# - Proxmox Virtual Environment setup.
@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 April 23, 2025 19:01
UniFi AP Buyers Guide

UniFi AP Buyers Guide

(updated March 2025)

The APs in this list are ordered from highest to lowest performance. However, unless you have an insane amount 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. In terms of best price-to-performance, the U6 Pro/Mesh/InWall series is the sweet spot in my opinion and is the best choice for most deployments.

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 April 24, 2025 05:05
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"
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active January 14, 2025 21:05
CollapsingTitleLayout
/*
* 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