Skip to content

Instantly share code, notes, and snippets.

View alexclst's full-sized avatar

Alexander Celeste alexclst

  • Minnesota, United States
  • 17:38 (UTC -05:00)
View GitHub Profile
@alexclst
alexclst / scss-compile.php
Created December 9, 2023 23:19
WP MU plugin to force WP-SCSS plugin to run with desired settings, which can be changed in this file when you download it for installation.
<?php
/**
* Plugin Name: SCSS Compile
* Description: Makes sure SCSS compilation is ready.
* Author: Tenseg LLC
* Author URI: https://www.tenseg.net
* Text Domain: tg-scss-compile
* Version: 1.0.0
*
* @package tg-scss-compile
@alexclst
alexclst / pmpro-sandbox.php
Created December 9, 2023 22:15
A WP MU plugin that enforces sandbox settings on Paid Memberships Pro. Edit settings as needed in your copy.
<?php
/**
* Plugin Name: PM Pro Sandbox
* Description: Makes sure that PM Pro is in sandbox mode by forcing the developer's toolkit to run with specific settings, and killing off all pmpro plugins if it isn't found.
* Author: Tenseg LLC
* Author URI: https://www.tenseg.net
* Text Domain: tg-pmpro-sandbox
* Version: 1.0.0
*
* @package tg-pmpro-sandbox
@alexclst
alexclst / force-stripe-testmode.php
Created February 10, 2023 17:01
Force Stripe Test Mode in WooCommerce
<?php
/**
* Plugin Name: Force Stripe Test Mode
* Plugin URI: https://tenseg.net
* Description: Forces Stripe into test mode if TG_STRIPE_TEST_MODE defined as 'yes'.
* Author: Tenseg LLC
* Author URI: https://tenseg.net
* Text Domain: force-stripe-test-mode
* Version: 1.0.0
@alexclst
alexclst / deploy-wp-plugin.sh
Last active August 12, 2021 15:59
Git hook to deploy a WP plugin.
#! /bin/bash
#
# A script meant to run on the `post-recieve` Git hook to deploy to WordPress.org whenever a new version tag is pushed in.
# include common post-recieve functions
# from https://github.com/stephenh/git-central/blob/master/server/functions
root_dir=$(dirname $0)
. $root_dir/post-recieve-functions.sh
# cleans up before exiting
@alexclst
alexclst / broadlink-rm-platform.json
Last active July 15, 2020 19:22
My platforms entry in Homebridge for BroadlinkRM IR blasters.
@alexclst
alexclst / com.homebridge.server.plist
Created July 15, 2020 18:19
Launchd plist for running Homebridge on macOS.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>HOME</key>
<string>/Users/apple</string>
<key>PATH</key>
<string>/Users/apple/.yarn/bin:/Users/apple/.config/yarn/global/node_modules/.bin:/usr/local/opt/unison@2.40/bin:/Users/apple/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
@alexclst
alexclst / unserialize.sh
Last active June 25, 2020 19:43
BBEdit text filter to unserialize WP data into pretty JSON.
#! /usr/local/bin/php
<?php
// unserialize input
$data = unserialize(trim(fgets(STDIN)));
// print it as pretty unescaped json
echo json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
@alexclst
alexclst / db-error.php
Last active March 19, 2020 21:38
DB Error File Example for WP
<?php
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600'); // 1 hour = 3600 seconds
?>
<!DOCTYPE html>
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<meta charset="UTF-8" />
@alexclst
alexclst / sshd_config
Created December 28, 2019 23:22
SSH Config without Password Auth
# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
@alexclst
alexclst / homebrewupdate.sh
Last active March 15, 2023 02:31
Homebrew Update
#!/bin/sh
# updates Homebrew and installed packages
# requires being run as admin or root user
# here for reference as to the steps, but not run as script in launchd anymore
# partly because Homebrew updates itself anytime you install a new package these days
/bin/date
/opt/homebrew/bin/brew update
/opt/homebrew/bin/brew upgrade