Skip to content

Instantly share code, notes, and snippets.

View schlessera's full-sized avatar

Alain Schlesser schlessera

View GitHub Profile
#!/bin/env bash
# Mask sensitive key-value pairs in the output of the `env` command.
# This script is intended to be used as a filter for the `env` command output.
# It will replace the value of any key in the SENSITIVE_KEYS list with asterisks.
# Author: Alain Schlesser
# Link to the source gist: https://gist.github.com/schlessera/9851022e03cd669540cb3dfc3cb37915
# Original mention: https://x.com/schlessera/status/1820074260934566102
# Instructions for use:
@schlessera
schlessera / README.md
Last active September 5, 2022 01:57
Site setup script example

Site setup script example

This script is an example of how a custom site setup automation could look like to improve personal developer productivity.

This script was originally assembled by @johnbillion for a workshop at WordCamp Torino 2018.

See https://github.com/johnbillion/wctrn-site-setup-script.

@schlessera
schlessera / diagrams.js
Created February 22, 2022 22:10
Gulp task to process PlantUML diagrams, including those found in source code (OLD)
var gulp = require('gulp');
var rename = require('gulp-rename');
var changed = require('gulp-changed');
var request = require('sync-request');
var through = require('through2');
var gutil = require('gulp-util');
var prettyHrtime = require('pretty-hrtime');
var fs = require('fs');
var config = require('../config');
@schlessera
schlessera / amp-disable-esm.php
Last active May 8, 2021 17:27
AMP Disable ES Modules
<?php
/**
* AMP Disable ES Modules.
*
* @package AMP_Disable_ESM
* @author Alain Schlesser <alain.schlesser@gmail.com>
* @link https://gist.github.com/schlessera/4127ab30f4235f1acbc11e3eee77701a
* @license GPL-2.0-or-later
*
* @wordpress-plugin
@schlessera
schlessera / amp-disable-optimizer.php
Last active March 29, 2021 19:56
AMP Disable Optimizer
<?php
/**
* AMP Disable Optimizer
*
* @package AMP_Disable_Optimizer
* @author Alain Schlesser <alain.schlesser@gmail.com>
* @link https://gist.github.com/schlessera/3c279bac46b3437966e5812901e5f923
* @license MIT
*
* @wordpress-plugin
@schlessera
schlessera / README.md
Last active February 3, 2020 23:21
Simple script to quickly create a fresh WordPress installation in a subfolder.
@schlessera
schlessera / RoboFile.php
Created December 14, 2019 14:46
Simple script to quickly create a fresh WordPress installation in a subfolder.
<?php declare( strict_types=1 );
final class RoboFile extends \Robo\Tasks {
public function createEmpty( string $name, string $tld = 'localhost', string $email = 'alain.schlesser@gmail.com' ) {
$io = $this->io();
$root = __DIR__;
$io->title( 'Creating an empty local WordPress site' );
@schlessera
schlessera / script.md
Last active April 13, 2023 10:54
Siteground webinar - Learn How WP-CLI Can Make Your Life Easier

Siteground webinar - Learn How WP-CLI Can Make Your Life Easier

Webinar description

WP-CLI, the command-line interface for WordPress, is one of the most popular tools among WordPress developers. However, it can be extremely helpful for anyone managing a WordPress site. In this webinar, the main person behind WP-CLI project: Alain Schlesser will show us the ins and outs of the tool. He will give us great examples on how it can be used to improve your workflow, for beginners to experienced developers and for projects big and small. We will give you invaluable examples on how to perform different tasks with WP-CLI automatically, saving you time and preventing you from making manual errors, like:

  • Keep forgetting to backup? Automate the process with WP-CLI.
  • Site not working? Get tips for easy troubleshoot with WP-CLI.
  • Too many spam comments? Learn how to clean them in no time.
  • Can’t log into your site? Reset your password with WP-CLI.

Keybase proof

I hereby claim:

  • I am schlessera on github.
  • I am schlessera (https://keybase.io/schlessera) on keybase.
  • I have a public key ASAwZ3hewGFJXOlKo5p5dYD5Q-gmmvQDfsbyTKID3Uo09wo

To claim this, I am signing this object:

@schlessera
schlessera / Plugin.php
Last active September 29, 2017 17:15
Using Value Objects for Dependency Injection
<?php
class Plugin
{
protected $plugin_root;
private $loaded;
public function __construct(PluginRoot $plugin_root)
{