Skip to content

Instantly share code, notes, and snippets.

View drawcard's full-sized avatar
👍

Drawcard drawcard

👍
  • Drawcard
  • Australia
View GitHub Profile
@drawcard
drawcard / .htaccess
Last active March 15, 2023 12:40 — forked from anova/.htaccess
Multisite and giving wordpress its own directory
<IfModule mod_rewrite.c>
# not localhost:
# Replace "SUBDIRECTORY" with your subdir path
# RewriteCond %{HTTP_HOST} \.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
#eliminate root path access denied: (without placeholder index.php)
RewriteRule ^(/)?$ SUBDIRECTORY/index.php [L]
@drawcard
drawcard / random-troubleshooting-zsh.md
Last active April 23, 2020 00:12
Random troubleshooting - ZSH

ZSH

Insecure directories and files warning

zsh compinit: insecure directories and files, run compaudit for list.                                                                                                                                
Ignore insecure directories and files and continue [y] or abort compinit [n]? y

Fix this by running

@drawcard
drawcard / wp-cli-migrate.md
Created February 25, 2020 02:17
Manually migrate production WP DB to local environment, using WP CLI

This guide assumes you’re using https://localwp.com for your local environment.

Pull DB from the production server

  • wp db export ~/.mysqldump/wp_transfer.sql

Transfer DB from the production server to local

  • Connect to server via FTP
  • Transfer ~/.mysqldump/wp_transfer.sql to your desktop
@drawcard
drawcard / mc-server-setup.md
Last active November 13, 2018 02:40 — forked from niksudan/mc-server-setup.md
How to create a new Minecraft Server with DigitalOcean

Creating a new Minecraft Server

Setup

Create a new Ubuntu 16.04 droplet on DigitalOcean. Make sure it has at least 2GB of RAM, and you provide it with your SSH key.

SSH into the server and install Java, which is required for Minecraft to run.

@drawcard
drawcard / wp.sh
Created November 7, 2018 04:58 — forked from phlbnks/wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser
@drawcard
drawcard / wp.sh
Created November 7, 2018 04:58 — forked from phlbnks/wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser
@drawcard
drawcard / glyphs-font-design-process.md
Last active July 3, 2017 11:52
Glyphs Font Design Process

Font Design Process - Glyphs

For drawing a complete sans-serif Latin Alphabet

Initial Setup

  • Preferences > Addons > Modules > Install Modules
  • Start with Regular font master
  • Font Info > Masters > Metrics: Set values for each of these (or use / slightly adjust the defaults)

General approach

@drawcard
drawcard / woocommerce-update-old-overrides.md
Last active May 7, 2017 02:29
WooCommerce - Updating old theme override files to latest version

The Problem

Let's say you've inherited a theme from a client that some other developer made a long time ago, and your job is to update the code and figure out what stays and what doesn't.

Occassionally WC will update its core template library and this will get out of sync with any overrides in a given theme's /woocommerce/ folder. WC will send an alert in the WP backend that various templates are out of date and need updating. The theme will need its override files updated.

(Version examples for this demo: 2.1.1 is old, 3.0.0 is latest)

Identification

Go to https://xxxxxxx.zzz/wp-admin/admin.php?page=wc-status and scroll to Templates to see what files are problematic.

@drawcard
drawcard / wp-setup-management-2017.md
Last active March 21, 2017 05:22
Wordpress Setup & Management 2017

WP-CLI Stuff

Handy Shortcuts

Search & Replace Database

### Remove "dry-run" to write the changes to the DB! 
### Run "wp db export" to back up DB first!

DO NOT BLINDLY COPY AND PASTE THESE, CHANGE THE DIRECTORY PATHS IN THEM FIRST!
@drawcard
drawcard / setup_mailcatcher.sh
Last active February 9, 2017 07:31 — forked from shark0der/setup_mailcatcher.sh
Mailcatcher installation script for Ubuntu 16.04 (14.04 commands commented out)
#!/bin/bash
# Install dependencies
# older ubuntus
#apt-get install build-essential libsqlite3-dev ruby1.9.1-dev
# xenial
apt install build-essential libsqlite3-dev ruby-dev
# Install the gem
# gem install mailcatcher