Skip to content

Instantly share code, notes, and snippets.

@justintime
justintime / rule1.haskell
Last active January 3, 2024 18:04
Tasmota Watchdog
Rule1
ON system#boot do Var1 3 ENDON
ON system#boot do Var2 0 ENDON
ON Var1#State>1439 DO Var1 1439 ENDON
ON Time#Minute|%var1% DO backlog WebQuery http:/www.google.com/ GET ENDON
ON WebQuery#Data$!Done DO backlog Add2 1 ENDON
ON Var2#state >= 2 DO backlog Mult1 2; Power1 0; Delay 10; Power1 1; Var2 0 ENDON
ON WebQuery#Data=Done DO Var1 3; Var2 0 ENDON
@devinsays
devinsays / ActionSchedulerHighVolume.php
Last active September 21, 2024 15:47
Modifications to Action Scheduler in order to run higher volumes of actions.
<?php
/**
* High volume modifications to Action Scheduler.
*
* Adapted from https://github.com/woocommerce/action-scheduler-high-volume/
*
* Increase Action Scheduler batch size, concurrency, timeout period, and claim action query
* ORDER BY to process large queues of actions more quickly on servers with more server resources.
*
* @package UniversalYums\ActionScheduler
@ianmjones
ianmjones / build-as3cf-aws3.sh
Last active March 26, 2024 08:34
A script for downloading the AWS PHP SDK v3, stripping down to S3 functionality and then applying a custom namespace.
#!/usr/bin/env bash
set -e
if [ ! -d src/amazon-s3-and-cloudfront ]; then
echo 'This script must be run from the repository root.'
exit 1
fi
for PROG in composer find sed unzip
@thomaswitt
thomaswitt / VPNConfigurationProfiles.mobileconfig
Last active January 23, 2025 06:58
An OnDemand VPN iOS profile for iPad and iPhone that automatically connects you to different VPNs (e.g. Meraki, FRITZ!Box and Streisand) | Blog-Entry: https://thomas-witt.com/auto-connect-your-ios-device-to-a-vpn-when-joining-an-unknown-wifi-d1df8100c4ba
<?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>PayloadContent</key>
<array>
<!-- Home: Manual -->
<dict>
<key>UserDefinedName</key>
@zaus
zaus / enviro-switch.php
Created December 11, 2015 21:06
wp-config DEBUG
switch($_SERVER['HTTP_HOST']) {
case 'wp.sandbox:81':
define('DB_NAME', 'YOURDB');/** The name of the database for WordPress */
define('DB_USER', 'YOURUSER');/** MySQL database username */
define('DB_PASSWORD', 'YOURPASS');/** MySQL database password */
define('DB_HOST', 'localhost');/** MySQL hostname */ // may need to use actual computer ip in some cases
break;
default:
define('DB_NAME', 'YOURDB');/** The name of the database for WordPress */
define('DB_USER', 'YOURUSER');/** MySQL database username */
@nadeem-khan
nadeem-khan / Create-Custom-Fields-in-Woocommerce-Checkout-Page.md
Last active July 21, 2022 19:16
Create Custom Fields in Woocommerce Checkout Page and Display them in Orders Details Page in Admin Area

Create Custom Fields in Woocommerce Checkout Page and Display them in Orders Details Page in Admin Area with this WordPress plugin:

<?php


/**
 * Plugin Name: Flowershop - WooCommerceCustomOverrides
 * Plugin URI: http://chillopedia.com
 * Description: Overrides WooCommerce Checkout Form Fields
  • Version: 1.0
@PeterBooker
PeterBooker / wp-cloudfront.php
Created July 24, 2014 17:09
Make WordPress fully comptible with AWS CloudFront, to use as a full-page caching solution.
<?php
/**
* Add Last-Modified and Cache-Control Headers to WP Responses
*/
function wp_cloudfront_filter_headers( $headers ) {
/*
* WP already sets Cache-Control headers to avoid caching in the admin.
*/
if ( is_admin() ) {
@timothyandrew
timothyandrew / README.md
Last active December 16, 2023 17:05
Set up a seedbox (on DigitalOcean – Ubuntu) really quick

Introduction

  • This script lets you set up and use a temporary DigitalOcean droplet to download torrent files.
  • Once downloaded, they can be streamed down to your local machine.
  • This uses transmission-cli for the torrent client, and nginx to serve files.

Setup on Local Machine

  • This assumes that you have a DigitalOcean account and tugboat set up, as well as seedbox-setup.sh present in the current directory.
@michaelklapper
michaelklapper / virtualbox_vagrant_home.bat
Last active May 23, 2023 06:24
Reconfigure VirtualBox and Vagrant home directory for Windows Set VirtualBox home directory to: C:\VMs Store vagrant boxes: C:\VMs\vagrant.d
# VirtualBox home directory.
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" setproperty machinefolder "C:\VMs"
# Vagrant home directory for downloadad boxes.
REG ADD HKCU\Environment /v VAGRANT_HOME /t REG_SZ /d "C:\VMs\vagrant.d"
@codelance
codelance / config.php
Last active April 14, 2018 07:27
Add mailchimp subscribe to woocommerce checkout.
/**
* Subscribe User to MailChimp
*/
function wooms_mailchimp_subscribe_user($order_id,$posted){
if(!empty($_POST['wooms_susbscribe']) && $_POST['wooms_susbscribe'] == '1'){
try{
$email = $posted['billing_email'];
$merge_vars = array('FNAME' => $posted['billing_first_name'],'LNAME' => $posted['billing_last_name']);
$api = new MCAPI(mailchimp_api_key);