Skip to content

Instantly share code, notes, and snippets.

View LachlanArthur's full-sized avatar
🐊

Lachlan Arthur LachlanArthur

🐊
View GitHub Profile
@LachlanArthur
LachlanArthur / convert.ps1
Created July 2, 2023 12:14
ffmpeg batch conversion
$indir = Resolve-Path 'in';
$outdir = Resolve-Path 'out';
$ffmpegBin = Get-Command -Name 'ffmpeg' -All -CommandType Application -ea Stop
$inputArgs = (
# '-loglevel', 'debug',
# GPU decode
# '-c:v', 'h264_cuvid',

Alien Colonial Marines Talents

All-Terrain Driver

Almost anyone can drive a tractor or APC, but with this talent you have experience driving all-terrain vehicles over rough terrain whilst minimizing damage to the vehicle.

Banter

Between fights, you release the tension in your team with some friendly banter.

Bodyguard

If someone within SHORT range of you is hit by an attack, you can dive in to take the hit.

interface ExtraAttributes {
role: string,
style: string | ( Partial<CSSStyleDeclaration> & Record<string, string> ),
classList: string[],
charset: string,
}
declare var React;
declare namespace JSX {
#requires -Version 2 -Modules posh-git
function Write-Theme {
param(
[bool]
$lastCommandFailed,
[string]
$with
)
# Install Scoop
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# Exclude scoop dirs from Windows Defender
scoop install sudo
sudo Add-MpPreference -ExclusionPath "$env:HOME\scoop"
sudo Add-MpPreference -ExclusionPath "$env:ProgramData\scoop"
# Enable parallel downloads
@LachlanArthur
LachlanArthur / unhook_class_method.php
Last active November 11, 2019 05:31
WordPress - Unhook a class method from an action or filter, even if you don't have a reference to the class instance.
<?php
/**
* Removes hooks that trigger a certain class method,
* even if you don't have a reference to the class instance.
*
* @global \WP_Hook[] $wp_filter
* @param string $filter
* @param string $class
* @param string $method
@LachlanArthur
LachlanArthur / fader.js
Created June 19, 2019 08:29
Fader.js - Toggle a class between child elements. Make a simple gallery fader!
/**
* Toggle a class between child elements. Make a simple gallery fader!
*
* @param {Element} parent The wrapper element
* @param {string} activeClass Class to add to active child
* @param {number} timeout Milliseconds to wait between children
* @returns {() => void} Stop function that ends the fader
*
* @fires `beforeNext` Event fires before switching to new child. Bubbles. Cancelable with `preventDefault()`.
* - `e.target` => Current child
@LachlanArthur
LachlanArthur / gravityforms_select_optgroup.php
Created February 22, 2019 05:54
Add optgroup support to Gravity Forms select fields
<?php
/**
* Add `<optgroup>` support to `<select>` fields.
*
* Create optgroups by adding options with values `optgroup-something`.
* All subsequent options will be in the group.
*
* @param string $choice_markup The current option HTML
* @param array $choice The current choice data
@LachlanArthur
LachlanArthur / ublock
Last active November 20, 2020 01:22
My uBlock Origin Custom Filters
! add exception to EasyList rule to let YouTube track video progress
@@||s.youtube.com/api/stats/watchtime*
www.hackertyper.com###menu
www.engineeringtoolbox.com##.adblo
! 05/12/2018, 17:27:38 All Medium sites - Old
! ##head[prefix*="medium-com"] + body .metabar
! ##head[prefix*="medium-com"] + body .js-followState
@LachlanArthur
LachlanArthur / ansi_colours.ps1
Created November 21, 2018 14:09
Powershell ANSI Colour Variables
$E = [char]0x001b
$CB_Reset = "$E`[0m"
$C_Default = "$E`[39m"
$C_Black = "$E`[30m"
$C_Red = "$E`[31m"
$C_Green = "$E`[32m"
$C_Yellow = "$E`[33m"
$C_Blue = "$E`[34m"