Skip to content

Instantly share code, notes, and snippets.

View lucatume's full-sized avatar

theAverageDev (Luca Tumedei) lucatume

View GitHub Profile
@lucatume
lucatume / README.md
Last active October 10, 2023 11:12
Generate The Events Calendar test events using wp-cli

The Events Calendar load test generation plugin

A wp-cli generator of test events.

Installation and activation

Copy the "Raw" version of the tec-load-test.php file to a file called tec-load-test.php in your WordPress installation plugins folder.
Activate the plugin, via the WordPress Plugins administration page as you would do for any other plugin.

Usage

@lucatume
lucatume / install.sh
Last active July 21, 2019 13:28 — forked from christopher-hopper/phpenv-macos.sh
Install phpenv on macOS with homebrew php packages(5.6, 7.0, 7.1, 7.2, 7.3)
source <(curl https://gist.githubusercontent.com/lucatume/f82b6942b5926d42d31402c03ef25aee/raw/f14a153b1aa74c3311c9bc2e756d45952007deaa/phpenv-osx.sh)
@lucatume
lucatume / Acceptance.php
Created January 23, 2019 09:46
Codeception Acceptance Helper modified to add a saveHtmlSnapshot method
<?php
namespace Helper;
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class Acceptance extends \Codeception\Module {
public function saveHtmlSnapshot( string $snapshot = null ) {
@lucatume
lucatume / Panel.php
Last active January 22, 2019 15:39
WordPress main query vars and props debug bar panel. Download the files and put them in a folder in the WordPress installation plugins folder.
<?php
class QueryDebugBarPanel
extends Debug_Bar_Panel {
function title( $title = null ) {
return 'Query';
}
function render() {
@lucatume
lucatume / restore.sh
Created September 28, 2018 06:16
Restore Local by Flywheel db from import files
#!/bin/bash
db_user=root
db_pass=root
db_host="192.168.92.100"
db_port="4018"
dbs=("local" "wordpress")
for db in ${dbs[@]}; do
mysql -u ${db_user} -p${db_pass} -h${db_host} -P${db_port} -e "drop database if exists $db"
@lucatume
lucatume / imagick-installation-5-2-17.sh
Last active July 13, 2021 04:35
Local Addon Docker Containers PHP extensions installation
# While working with Local, by FlyWheel, there might be the need to install the Imagick PHP
# extension on specific PHP version used in the container serving the site.
# The Imagick PHP extension version is locked to compile on PHP 5.2.17 but newer versions of PHP
# might allow using the latest version.
bash -c 'export IMAGICK_VERSION=3.1.2 && \
export PHP_VERSION=5.2.17 && \
apt-get update && \
apt-get install imagemagick libmagickcore-dev libmagickwand-dev wget make autoconf -y && \
export WAND_BINARY=$(find / -name "MagickWand-config") && \
mkdir -p $($WAND_BINARY --prefix)/include/wand && \