Skip to content

Instantly share code, notes, and snippets.

@TaylorJadin
TaylorJadin / checkboxes.html
Last active January 10, 2023 16:20
checboxes with saved states
View checkboxes.html
<div class="checkbox-list">
<p>
<input type="checkbox" class="save-cb-state" name="unique-name-1" value="no">
</p>
</div>
<script src="https://code.jquery.com/jquery.js"></script>
<script>
// Avoid scoping issues by encapsulating code inside anonymous function
@TaylorJadin
TaylorJadin / plugin.php
Created October 21, 2022 16:48
WordPress Plugin starter
View plugin.php
<?php
/**
* Plugin Name: My neato plugin
* Plugin URI: https://github.com/TaylorJadin/tiny-wordpress-plugins
* Description: This plugin does things, probably.
* Version: 1.0
* Author: Taylor Jadin
* Author URI: https://jadin.me/
**/
@TaylorJadin
TaylorJadin / gtmetrix
Last active August 30, 2022 18:16
Submit multiple URLS to gtmetrix using their API
View gtmetrix
#!/bin/bash
# Config
GTMETRIX_API_KEY=
SLEEP_TIME=5
# Functions
function submit_test {
curl -s -u $GTMETRIX_API_KEY: \
-X POST -H Content-Type:application/vnd.api+json \
@TaylorJadin
TaylorJadin / docker-compose.yml
Last active July 12, 2022 05:42
docker compose for nextcloud
View docker-compose.yml
version: '3.3'
services:
app:
image: nextcloud
restart: always
ports:
- '8080:80'
volumes:
- 'nextcloud:/var/www/html'
volumes:
@TaylorJadin
TaylorJadin / docker-compose.yml
Created July 5, 2022 13:31
starter docker-compose
View docker-compose.yml
version: '3.3'
services:
SERVICE_NAME:
image: DOCKERHUB_IMAGE
restart: always
ports:
- 'HOST_PORT:CONTAINER_PORT'
volumes:
- 'VOLUME_NAME_OR_PATH:PATH_INSIDE_CONTAINER'
environment:
View streamdeck-open-close.applescript
set appName to "Stream Deck"
set usbDeviceName to "Stream Deck"
set usbData to do shell script "system_profiler SPUSBDataType -detailLevel basic"
if usbData contains usbDeviceName then
log "Stream Deck connected"
if application appName is running then
log "Stream Deck.app is already running"
else
log "Launching Stream Deck.app"
@TaylorJadin
TaylorJadin / foundryBackup.sh
Created January 24, 2022 18:52
Backup foundrydata folder
View foundryBackup.sh
#!/bin/bash
FOUNDRYDATA="/home/jelastic/foundrydata"
DESTINATION="/home/jelastic/backups/"
BACKUPS_TO_KEEP=5
TIME_FORMAT=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
slow() {
start=`date +%s`
tar -cvJf "$DESTINATION/foundrydata-$TIME_FORMAT.tar.xz" $FOUNDRYDATA
@TaylorJadin
TaylorJadin / create-local-users.ps1
Created May 25, 2021 03:15
Create local users in bulk from a csv using powershell
View create-local-users.ps1
$importCSVpath="C:\users\paperspace\desktop\userlist.csv"
ForEach ($user in (Import-CSV $importCSVpath)){
$password = ConvertTo-SecureString $user.password -AsPlainText -Force
New-LocalUser -Name $user.username -Password $password -FullName $user.fullname
}
View chorus-adblock.txt
##.adblock-allowlist-messaging__wrapper
@TaylorJadin
TaylorJadin / backup.sh
Last active April 16, 2021 14:23
piboy pi backup
View backup.sh
#!/bin/bash
output=$1
sd="/dev/mmcblk0"
if [ -z "$output" ]
then
echo "No output path specified."
echo "Example: backup.sh /media/usb1/piboy.img.gz"
exit