Skip to content

Instantly share code, notes, and snippets.

View LachlanArthur's full-sized avatar
🐊

Lachlan Arthur LachlanArthur

🐊
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lachlanarthur on github.
  • I am lachlan (https://keybase.io/lachlan) on keybase.
  • I have a public key whose fingerprint is E818 A2FB 0842 D306 F059 42C9 EA0F 46EF FCCA E2A0

To claim this, I am signing this object:

@LachlanArthur
LachlanArthur / isotope.grid-mode.js
Last active August 29, 2015 14:21
Isotope Grid Mode
/*!
* grid layout mode for Isotope
* based on cellsByRows layout
*/
( function( window ) {
'use strict';
function GridDefinition( LayoutMode ) {
@LachlanArthur
LachlanArthur / datepicker.less
Last active May 11, 2016 08:35
Bootstrap 3 LESS for JQuery UI Datepicker
.ui-datepicker {
margin-bottom: @line-height-computed;
background-color: @panel-bg;
border: 1px solid transparent;
border-radius: @panel-border-radius;
.box-shadow(0 1px 1px rgba(0,0,0,.05));
border-color: @panel-default-border;
a {
border-radius: @border-radius-base;
@LachlanArthur
LachlanArthur / Adult Swim Downloader.ps1
Last active August 2, 2017 13:06
Adult Swim Downloader (Requires FFMpeg)
$VideoURL = Read-Host -Prompt 'Adult Swim video page URL'
$Temp = "temp_" + ( $VideoURL -replace '[<>:"/\\|?*]','_' )
New-Item -ItemType Directory -Path "./$($Temp)" -Force | Out-Null
if ( -not ( Test-Path "./$($Temp)/Video_Page.html" ) ) {
"Downloading webpage..." | Write-Host
Invoke-WebRequest $VideoURL -OutFile "./$($Temp)/Video_Page.html"
}
@LachlanArthur
LachlanArthur / !JS Helpers.md
Last active February 24, 2018 16:53
JS Helpers - Simple functions, sane types

JS Helpers

Simple functions, sane types

$() &amp; $$()

$( 'body' );
$$( 'button' );
$$<HTMLInputElement>( 'form#contact input' );
@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"
@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 / 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 / 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
# 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