Skip to content

Instantly share code, notes, and snippets.

summersab / appstore.php
Last active Feb 19, 2021
Add app and category whitelisting and blacklisting to Nextcloud
View appstore.php
* @copyright Copyright (c) 2021, Platypus Innovations LLC
* @author Andrew Summers
* This snippet provides a way to implement app and category whitelists/
* blacklists on Nextcloud. This is accomplished by creating a dummy
* "appstore" on the local system:
* - Download the official listings from the Nextcloud servers
summersab / FoxyCustomClient.php
Last active Feb 14, 2021
Extension of the FoxyCart PHP SDK to include auto-debugging
View FoxyCustomClient.php
require './vendor/autoload.php';
use Foxy\FoxyClient\FoxyClient;
class FoxyCustomClient extends FoxyClient {
private $parent_class_filename = "";
private $last_function_line = "";
private $last_function = "";
summersab / signifyd-webhook.php
Last active Oct 19, 2020
SignifyD Webhook JSON Validation (PHP)
View signifyd-webhook.php
function validatePostedJson() {
$json = file_get_contents('php://input');
if ($json == null) {
header('HTTP/1.1 400 Bad Request', true, 400);
die('No Data Found');
//Check the Hash
summersab /
Last active Oct 16, 2020
SignifyD Webhook JSON Validation (Java)
// Use JDK 1.8.0_66
// Test here to make life easy:
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;
public class Main {
summersab / Foxy_url_params.js
Created Aug 13, 2020
Quick JS script to dump products in a Foxy session to URL params
View Foxy_url_params.js
// These are the bare minimum fields that you should exclude from the URL params:
//skip = ['id', 'item_number', 'sub_enddate', 'sub_nextdate', 'sub_startdate'];
// You can exclude these without problems - keeps things shorter:
skip = ['id', 'item_number', 'downloadable_id', 'expires', 'height', 'is_parent', 'length', 'multiship', 'parent_code', 'price_each', 'price_each_is_fractional', 'price_is_fractional', 'quantity_max', 'quantity_min', 'shipto', 'sub_enddate', 'sub_frequency', 'sub_frequency_raw', 'sub_nextdate', 'sub_startdate', 'url', 'weight', 'weight_each', 'width'];
FC.json.items.forEach(function(item) {
var urlArr = {};
Object.keys(item).forEach(function(el) {
if (!skip.includes(el)) {
summersab /
Last active Jul 29, 2020 — forked from malarkey/Contract Killer
The latest version of my ‘killer contract’ for web designers and developers

Easy-To-Understand Freelance Developer Contract

Based on the popular open-source "Contract Killer" for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Modified by Platypus Innovations, LLC: July 29, 2020
  • Original post

summersab / cors.php
Last active Sep 4, 2020
CORS Function
View cors.php
$allowedOrigins = [
$origin = cors($allowedOrigins, 'GET, POST');
summersab / github-emails-bookmarklet.js
Last active Dec 26, 2019
Quickly find emails for a GitHub user
View github-emails-bookmarklet.js
javascript:(function()%7B%2F%2FTurn this into a bookmarklet using a tool like %3D %5B%5D%3B%0Axhr %3D new XMLHttpRequest()%3B%0A%0Axhr.onload %3D () %3D> %7B%0A%09if (xhr.status %3D%3D 200) %7B%0A%09%09var result %3D JSON.parse(xhr.response)%3B%0A%09%09result.forEach(function(obj) %7B%0A%09%09%09if (obj.type %3D%3D %27PushEvent%27) %7B%0A%09%09%09%09email %3D (email.includes(%27noreply%27) %7C%7C email.includes(%27no-reply%27)) %7B%0A%09%09%09%09%09%2F%2FI know there%27s a better way to do this%2C but I%27m too lazy. This works.%0A%09%09%09%09%7D%0A%09%09%09%09else if (!emails.includes(email)) %7B%0A%09%09%09%09%09emails.push(email)%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D)%3B%0A%09%09if (emails.length > 0) %7B%0A%09%09%09output %3D emails.join(%27%2C%27)%3B%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09output %3D "No emails found."%3B%0A%09%09%7D%0A%09%09var textnode %3D document.createT
summersab /
Last active Nov 3, 2019
A dirty script to help find functions defined in PHP scripts or a directory tree containing PHP files.
while getopts ":hf:p:" opt; do
case ${opt} in
h )
summersab /
Last active Nov 3, 2019
Shell script to find all WordPress functions used in a directory
if [ ! -e "$1" ]
echo Invalid file or directory.