This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import boto3 | |
| import os | |
| import logging | |
| import sys | |
| import threading | |
| import tkinter as tk | |
| from tkinter import ttk, filedialog, messagebox | |
| from typing import Optional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set the environment variables from Portainer | |
| # | |
| # REDIS_PASSWORD=some_secure_password | |
| version: "3.9" | |
| services: | |
| redis: | |
| container_name: redis | |
| image: redis/redis-stack:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Updated with https://gist.github.com/ipokkel/fdfeb10a8120777661fbef4e8ed80fa0 | |
| * This gist is kept for archival purposes, use the updated one above please. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // Do NOT copy this line | |
| /* Copy from below this line */ | |
| /* | |
| Remove state from required billing fields and hide it the state field. | |
| */ | |
| // Unset state | |
| function my_pmpro_required_billing_fields( $fields ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Enter your license key below | |
| license_key=XXXXXXXXXXXXXXXXX | |
| curl -O -J -L 'https://sendy.co/download/?license=${license_key}' | |
| filename=$(basename -- sendy-*.zip) | |
| newdir="${filename%.*}" | |
| echo ${newdir} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function woocommerce_maybe_add_multiple_products_to_cart() { | |
| // Make sure WC is installed, and add-to-cart qauery arg exists, and contains at least one comma. | |
| if ( ! class_exists( 'WC_Form_Handler' ) || empty( $_REQUEST['add-to-cart'] ) || false === strpos( $_REQUEST['add-to-cart'], ',' ) ) { | |
| return; | |
| } | |
| // Remove WooCommerce's hook, as it's useless (doesn't handle multiple products). | |
| remove_action( 'wp_loaded', array( 'WC_Form_Handler', 'add_to_cart_action' ), 20 ); | |
| $product_ids = explode( ',', $_REQUEST['add-to-cart'] ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo su | |
| //Setup Hostname | |
| hostnamectl set-hostname subdomain.domain.tld | |
| ## Basic | |
| sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y && sudo apt-get install software-properties-common | |
| //Setup SWAP | |
| sudo fallocate -l 1G /swapfile; | |
| ls -lh /swapfile; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('pmpro_checkout_before_submit_button', 'my_pmp_jquery'); | |
| function my_pmp_jquery() { | |
| global $current_user; | |
| get_currentuserinfo(); | |
| if ($current_user->user_login) { | |
| //script will hide billing fields and prefill name and email from WP account | |
| ?> | |
| <script> | |
| jQuery( document ).ready(function($) { |