Skip to content

Instantly share code, notes, and snippets.

@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 May 4, 2024 09:16
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 April 18, 2024 16:05
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
@jeffersonmartin
jeffersonmartin / composer-private-package-github-token.md
Last active April 11, 2024 11:22
Generate a GitHub Personal Access Token for Private Composer Packages

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit https://github.com/settings/tokens.

  2. Click Generate new token.

@mihow
mihow / load_dotenv.sh
Last active May 4, 2024 12:32
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi