Skip to content

Instantly share code, notes, and snippets.

View Makeshift's full-sized avatar

Connor Bell Makeshift

  • Reading
View GitHub Profile
@Makeshift
Makeshift / start-x4-debug.ps1
Last active October 10, 2023 19:53
Run X4 with debug on, keeps the powershell window open following the main debug log file, and filters out some spam that usually isn't helpful
###### Config ######
$X4InstallDir = "C:\GOG Games\X4 Foundations"
# Saves the filtered logfile to $LogFileName, and the unfiltered logfile to $LogFileName-verbose
$SeparateVerboseLogs = $true
#$MakeShortcutPath = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\X4 - Foundations [GOG.com]\X4 - Foundations.lnk"
# Define filters to remove the spam from the output
$filters = @(
"======================================"
"Failed to verify the file signature"
@Makeshift
Makeshift / magic.md
Created October 4, 2023 12:53
TS or JS object destructuring with default arguments and type hinting

(Note these examples are in pure NodeJS for simplicity, but this works fine in TS too if you set up the types correctly)

In classic JS, when passing an object as a function parameter, you had to destructure it yourself within the function body:

function a(options) {
  const {foo, bar} = options
  console.log(foo, bar)
}

This method works, but unfortunately means that your IDE type-hinting isn't useful when calling this function, and won't tell you what options you have available:

@Makeshift
Makeshift / README.md
Last active July 23, 2023 17:33
Useful Destiny 2 DIM searches

t10s.txt

Highlights armour suitable to go into an n*T10 build.

Note: This does not take into account items with incredibly high stats making up for items with lesser stats. This simply tells you that each highlighted item will get you at least that number of tier 10 stats, assuming each other item in a loadout also has at least as much as the minimum.

2 Tier 10s

To get 2 T10 stats, you need your custom stat total (the 2 chosen stats you want to get to T10 added together) needs to be 200.
4 major stat mods get you 50, bringing the requirement down to 150. \

@Makeshift
Makeshift / s3-delete_noncurrent_versions.py
Created April 2, 2023 00:06
A script that deletes all noncurrent versions of files and delete markers in an S3 bucket
#!/usr/bin/env python3
# This script adapted from https://wasabi-support.zendesk.com/hc/en-us/articles/360058028992-How-do-I-mass-delete-non-current-versions-inside-a-bucket-
# This script is used to delete non-current versions of objects in a bucket. It will not delete the current version of an object.
# I also implemented refreshable sessions from here https://stackoverflow.com/a/69226170
"""
This scripts first argument must be an S3 URI (s3://bucket-name/<optional path>) from where to begin searching for noncurrent versions.
It will enumerate all objects under that prefix and delete all noncurrent versions.
Credentials are gathered automatically from the environment.
Wrap this script with aws-vault if that's how you get your credentials.
@Makeshift
Makeshift / my-target-arch.md
Created April 1, 2023 23:40
What's MYTARGETARCH and why are you using it?

You might see this style of multi-arch binary management in a few Dockerfiles that I maintain:

ARG TARGETARCH
ARG MYTARGETARCH="${TARGETARCH:-amd64}"

ARG MICROMAMBA_amd64_URL="https://micro.mamba.pm/api/micromamba/linux-64/latest"
ARG MICROMAMBA_arm64_URL="https://micro.mamba.pm/api/micromamba/linux-aarch64/latest"

RUN MICROMAMBA_URL_STR="MICROMAMBA_${MYTARGETARCH}_URL" && MICROMAMBA_URL="${!MICROMAMBA_URL_STR}" \
@Makeshift
Makeshift / tar.reg
Created September 2, 2022 11:59
Right-click tar options for Windows 10
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\SystemFileAssociations\.gz]
[HKEY_CLASSES_ROOT\SystemFileAssociations\.gz\shell]
[HKEY_CLASSES_ROOT\SystemFileAssociations\.gz\shell\extract]
@="Extract archive..."
[HKEY_CLASSES_ROOT\SystemFileAssociations\.gz\shell\extract\command]
@Makeshift
Makeshift / get-docker-stats.sh
Last active August 31, 2022 07:21
Docker stats in CSV with separated values in bytes
#!/bin/bash
function cleanLine() {
local line key field
line="$1"
key="$2"
field="$3"
echo "$line" | jq -r "$key" | tr -d 'BbIi' | awk "{print toupper(\$$field)}" | numfmt --from=auto
}
// ==UserScript==
// @name Manual Import Select All
// @match https://sonarr.makeshift.ninja/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var SelectionManager = {};
@Makeshift
Makeshift / docker-compose.override.yml
Created November 8, 2021 18:26
Marauder - Extra Sonarr/Radarr
radarr4k:
image: makeshift27015/radarr
restart: unless-stopped
depends_on:
- rclone
volumes:
- /etc/localtime:/etc/localtime:ro
- ./runtime_conf/radarr4k:/config
- ./shared/:/shared:rshared
environment:
@Makeshift
Makeshift / docker-compose.yml
Created November 8, 2021 14:41
Marauder without Marauder
version: '3.4'
services:
nzbhydra:
image: linuxserver/nzbhydra2
restart: unless-stopped
network_mode: "host"
volumes:
- ./runtime_conf/nzbhydra:/config
environment:
- TZ=Etc/UTC