Skip to content

Instantly share code, notes, and snippets.

View morganestes's full-sized avatar

Morgan Estes morganestes

View GitHub Profile
@copyleftdev
copyleftdev / parallel.md
Created August 24, 2024 06:51
GNU Parallel Mastery: The Ultimate Cheat Sheet

🚀 GNU Parallel Mastery: The Ultimate Cheat Sheet

📊 Basic Usage

Command Description Example
parallel echo ::: A B C 🔤 Process items in parallel Output: A, B, C (in any order)
parallel echo {} ::: *.txt 🔍 Use {} as placeholder Echoes names of all .txt files
cat file.txt | parallel echo 📥 Read input from stdin Processes each line of file.txt
parallel -j4 command ::: item1 item2 item3 🔢 Limit to 4 jobs at a time Runs 'command' on items, max 4 parallel

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@ccharlton
ccharlton / quicksilver.yml
Last active February 25, 2024 05:56
Pantheon Quicksilver profiles pack
#
# Quicksilver configuration file
#
# Requirements:
# - Terminus Quicksilver plugin: https://github.com/pantheon-systems/terminus-quicksilver-plugin)
#
# Copy to $HOME/.quicksilver/quicksilver.yml
#
# To create your own repository with installable examples:
#
@danielbachhuber
danielbachhuber / disable-comments.php
Created May 15, 2019 16:34
Disable comments entirely from the WordPress backend
<?php
add_filter( 'comments_open', '__return_false' );
add_action( 'admin_menu', function(){
global $menu;
// Remove Comments
if ( isset( $menu[25] ) ) {
unset( $menu[25] );
}
@bradtraversy
bradtraversy / docker_wordpress.md
Last active December 4, 2025 14:35
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
<?php
add_action( 'admin_bar_menu', function( $wp_admin_bar ) {
$screen = get_current_screen();
if ( is_a( $screen, 'WP_Screen' ) ) {
$wp_admin_bar->add_node( [
'id' => 'screen_id',
'title' => sprintf( __( 'Screen ID: <kbd style="font-family: monospace; font-weight: 900;">%s</kbd>' ), esc_html( $screen->id ) ),
] );
<?php
namespace DeliciousBrains\Admin;
use DeliciousBrains\DBI;
class ACF {
public function init() {
add_filter( 'acf/settings/save_json', array( $this, 'get_local_json_path' ) );
@rmpel
rmpel / lbf.sh
Last active July 9, 2020 22:18
Local By Flywheel (unofficial) CLI for MacOS
#!/usr/bin/env bash
PRIMARY_LOCATION=~/Development
SECONDARY_LOCATION=/Volumes/Macintosh\ HD/Development
BROWSER=
CLOPS=
VERBOSE=true
SHOWHELP=false
SCHEME=http:
@danielbachhuber
danielbachhuber / http-to-https.php
Created March 28, 2018 19:45
Update a specific site from 'http://' to 'https://'.
<?php
/**
* Update a specific site from 'http://' to 'https://'.
*
* Only touches the 'home' and 'siteurl' options.
* Depending on plugins, etc., you may need to update other options too.
*
* Run on WordPress multisite with:
*
* wp site list --field=url | xargs -I % wp eval-file http-to-https.php --url=%
@ianmjones
ianmjones / build-as3cf-aws2.sh
Last active March 21, 2025 19:21
A script for downloading the AWS PHP SDK v2, 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