Skip to content

Instantly share code, notes, and snippets.

View rsoury's full-sized avatar
🍓
Foraging Berries

Ryan Soury rsoury

🍓
Foraging Berries
View GitHub Profile
@strarsis
strarsis / guide.md
Last active February 19, 2023 00:29
Object caching with Bedrock (and Trellis) using Redis

Object caching with Bedrock (and Trellis) using Redis

What is object caching

While nginx microcaching already solves page caching (as of static, rarely changing WordPress pages), the performance for dynamically generated pages (like WooCommerce shop pages and admin backend in general) can benefit greatly from additionally using an object cache. Object caching allows an application (in this case WordPress with its plugins, theme, etc.) to store prepared objects (mostly database queries) in a database and quickly retrieve them, therefore improving the performance of dynamic page generation. Object caching is (usually) transparent, which means that it shouldn't be noticeable by users and developers (except for the performance improvements of course).

Implementations

@sebsto
sebsto / gist:6af5bf3acaf25c00dd938c3bbe722cc1
Last active February 27, 2024 14:01
Start VNCServer on Mac1 EC2 Instance
# YouTube (english) : https://www.youtube.com/watch?v=FtU2_bBfSgM
# YouTube (french) : https://www.youtube.com/watch?v=VjnaVBnERDU
#
# On your laptop, connect to the Mac instance with SSH (similar to Linux instances)
#
ssh -i <your private key.pem> ec2-user@<your public ip address>
#
# On the Mac
@sumitpore
sumitpore / Commands.txt
Created April 4, 2020 09:09
Installing pcov extension on MacOS to be used with Local by Flywheel
git clone https://github.com/krakjoe/pcov.git
cd pcov
/usr/local/bin/phpize
./configure
export INCLUDE_PATH=/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-7.3.5+3/bin/darwin/include
make CPPFLAGS="-I${INCLUDE_PATH}/php -I${INCLUDE_PATH}/php/main -I${INCLUDE_PATH}/php/TSRM -I${INCLUDE_PATH}/php/Zend -I${INCLUDE_PATH}/php/ext -I${INCLUDE_PATH}/php/ext/date/lib"
sudo make install
sudo cp $(php-config --extension-dir)/pcov.so /usr/local/php/extensions
@lukecav
lukecav / wp-config.php
Last active December 30, 2021 09:25
iThemes Security Pro plugin constants that can be defined in a sites wp-config.php file
define(‘ITSEC_USE_CRON’, true);
define('ITSEC_DISABLE_MODULES', true);
define('ITSEC_DISABLE_TWO_FACTOR', true);
define('ITSEC_DISABLE_INACTIVE_USER_CHECK', true);
define(‘ITSEC_DEBUG’, true);
@blofeldthefish
blofeldthefish / White label Route 53 nameservers.md
Created August 23, 2018 19:42
AWS Route 53 white label nameserver setup
@ve3
ve3 / Encryption.js
Last active August 10, 2023 10:51
Encrypt and decrypt between programming languages (PHP & JavaScript). (Newer version here https://gist.github.com/ve3/b16b2dfdceb0e4e24ecd9b9078042197 )
/**
* Encryption class for encrypt/decrypt that works between programming languages.
*
* @author Vee Winch.
* @link https://stackoverflow.com/questions/41222162/encrypt-in-php-openssl-and-decrypt-in-javascript-cryptojs Reference.
* @link https://github.com/brix/crypto-js/releases crypto-js.js can be download from here.
*/
class Encryption {
@og24715
og24715 / httpProxyWithApiGateway.md
Last active January 10, 2020 00:07
Setting an HTTP Proxy on API Gateway by using Serverless framework.

HTTP オールスループロキシーを serverless で定義する

service: httpAllThroughProxy

provider:
  name: aws
  runtime: nodejs6.10

  stage: dev
@cdimascio
cdimascio / Configure awscli
Last active January 20, 2023 04:05
IBM Cloud Object Storage COS with AWS CLI
cat ~/.aws/config
[default]
region = us-standard
output = json
@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active March 20, 2024 00:17
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,

@tameemsafi
tameemsafi / emails.php
Last active April 15, 2024 12:42
Send an email programmatically in wordpress with wp_mail using the woocommerce transaction emails template.
<?php
// Define a constant to use with html emails
define("HTML_EMAIL_HEADERS", array('Content-Type: text/html; charset=UTF-8'));
// @email - Email address of the reciever
// @subject - Subject of the email
// @heading - Heading to place inside of the woocommerce template
// @message - Body content (can be HTML)
function send_email_woocommerce_style($email, $subject, $heading, $message) {