Skip to content

Instantly share code, notes, and snippets.

View GuyPaddock's full-sized avatar

Guy Elsmore-Paddock GuyPaddock

View GitHub Profile
@GuyPaddock
GuyPaddock / PrettierConsideredHarmful.md
Last active January 31, 2022 21:15
Reconsider Prettier

Prettier Considered Harmful

This is about the Prettier code formatting tool.

  1. Prettier runs counter to the Agile Manifesto. Several key tenets of the agile manifesto are about empowering small teams to make decisions for themselves:
    • "Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done."
    • "Continuous attention to technical excellence and good design enhances agility."
@GuyPaddock
GuyPaddock / encode_files.sh
Created June 12, 2021 02:43
Synology Encryption Key(s) to Base64-Encoded FIles
find . -name '*.key' | while read file; do
encoded=$(echo "${file}" | sed 's/\.key/\.b64/');
base64 -w0 "${file}" >"${encoded}";
done
@GuyPaddock
GuyPaddock / file_sizes_to_csv.sh
Last active December 14, 2021 16:01
Get sizes of files in a folder in CSV format
#!/usr/bin/env bash
echo "filename,size_bytes"
find "${1}" -type f | while read filename; do
stat --format="%n,%s" "${filename}";
done
@GuyPaddock
GuyPaddock / add_tiff_extension.sh
Created May 3, 2021 15:26
Add TIFF extension to all files
#!/usr/bin/env bash
find . -not -name '*.tiff' -type f -exec mv '{}' '{}.tiff' ';'
@GuyPaddock
GuyPaddock / git-transplant.sh
Created February 12, 2021 21:55
Transplant (rebase) a range of commits from one branch onto another
#!/usr/bin/env bash
# Stop on undefined variables and errors
set -u
set -e
get_commit_parent() {
local target_commit="$1";
local _parent_commit=`git log --pretty=%P -n 1 "${target_commit}"`;
@GuyPaddock
GuyPaddock / concave_object_to_convex_objects_by_face.py
Last active March 14, 2024 13:28
Blender 2.91 Script for Convex Hull Decomposition into Separate Shapes Using Blender's Convex using "Split Concave Faces"
##
# A script to split simple, architectural geometry into convex pieces.
#
# This script makes use of Blender's built-in "Split Concave Faces" clean-up
# algorithm to break-up the faces of an object into convex pieces. The script
# attempts to identify all the edges that represent convex boundaries, and then
# it splits objects up along those edges. Each resulting piece is then made into
# a closed object by converting it into a convex hull.
#
# Be sure to select the object you wish the split into convex pieces before
@GuyPaddock
GuyPaddock / LiveHome3dFbxCleanupAndExport.py
Last active March 18, 2024 01:47
Blender Script for Cleaning-up a Live Home 3D FBX for UE4
##
# This script can be run in Blender to re-arrange and clean-up an FBX model from
# Live Home 3D Pro so that it's more suitable for use in Unreal Engine 4/5.
#
# All objects in Live Home 3D should follow a naming convention similar to UE4
# naming conventions:
#
# SM_<Room Name>_<Element Type>
#
# For example:
@GuyPaddock
GuyPaddock / RenewAzureAdProxyCert.ps1
Last active February 1, 2024 22:06
PowerShell Script to Renew the SSL Certificate Used by the Application Proxy for an Azure AD Enterprise Application
################################################################################
# Script that renews a Let's Encrypt certificate for the Application Proxy of an
# Enterprise Application.
################################################################################
# This script can be run standalone from your local machine to automate the
# steps of a specific ACME renewal for Azure AD App Proxy application.
#
# Prior to using this script, you will need to ensure you have a DNS zone setup
# that points to your Azure AD App Proxy deployment. Azure AD will give you a
# hostname that will need to be referenced by a CNAME record in the zone. So,
@GuyPaddock
GuyPaddock / smpte.sh
Last active January 17, 2021 17:11
Adding SMPTE timecode to video recorded on Pixel 3
ffmpeg \
-i INPUT_FILE.mp4 \
-vf drawtext="fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: fontsize=96: box=1: boxcolor=black@0.75: boxborderw=5: fontcolor=white: x=(w-text_w)/2: y=((h-text_h)/2)-(3*((h-text_h)/8)):timecode='00\:00\:00\:00':rate=28.09" \
OUTPUT_FILE.mp4
@GuyPaddock
GuyPaddock / Getting Started with UE4 Infographic.svg
Last active December 14, 2020 12:49
Notes and Tips on Getting Started with Unreal Engine (my notes follow after my infographic)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.