Skip to content

Instantly share code, notes, and snippets.

View dotherightthing's full-sized avatar

Dan Smith dotherightthing

  • Do The Right Thing
  • Wellington, New Zealand
View GitHub Profile
@dotherightthing
dotherightthing / frameworks.md
Created August 15, 2019 15:23
[Frameworks]

Frameworks

  • Reuse reduces risk
  • Add limitations
  • Change adds time
@dotherightthing
dotherightthing / tgmpa-retrospective.md
Last active August 15, 2019 15:21
[TGMPA Retrospective] #tgmpa #wordpress

TGMPA Retrospective

Pros

  • feels like working with official WP plugins
  • theme and plugins can specify exact dependency versions

Cons

  • requires update to host site's TGMPA config to notify of new versions
@dotherightthing
dotherightthing / supplementing-sitehost.md
Created August 15, 2019 14:52
[Supplementing Sitehost]

Supplementing Sitehost

Major cloud vendors have offered containers as a service products, including Amazon Elastic Container Service, AWS Fargate, Google Kubernetes Engine, Microsoft Azure Container Instances (ACI), Azure Kubernetes Service and IBM Cloud Kubernetes Service.

@dotherightthing
dotherightthing / amazon-mechanical-turk.md
Created August 15, 2019 14:51
[Amazon Mechanical Turk]

Amazon Mechanical Turk

"Artificial Artificial Intelligence" ;-)

@dotherightthing
dotherightthing / hide-acf-admin-menu.md
Created August 15, 2019 14:48
[Hide ACF admin menu] #wordpress

Hide ACF admin menu

// wp-config.php

/* Removes ACF admin menu (for live site) */define( 'ACF_LITE', true );
@dotherightthing
dotherightthing / console-log-to-terminal.md
Last active August 18, 2019 16:13
[Console log to Terminal] #commandline #debug

Console log to Terminal

Log to terminal to save space:

tail -f /path/to/file.log

tail is a unix command to watch a log file for changes in real time

See:

@dotherightthing
dotherightthing / adding-a-development-branch-after-pushing-to-master.md
Created August 15, 2019 14:45
[Adding a development branch after pushing to master] #git

Adding a development branch after pushing to master

If you forget to create a development branch before developing, then need to patch master:

  1. Create a branch from the last commit
  2. Stash any uncommitted changes
  3. Reset the master branch to the last tagged release (or whenever)
  4. git push -f [email protected]:dotherightthing/reponame.git

If you try to do (4) via SourceTree then Github will complain that "github Updates were rejected because a pushed branch tip is behind its remote"

@dotherightthing
dotherightthing / extracting-a-single-site-from-a-multisite-database.md
Created August 15, 2019 14:43
[Extracting a single site from a multisite database] #wordpress

Extracting a single site from a multisite database

  1. This is not possible using UpdraftPlus.
  2. Go into SequelPro, locate the tables used by the subsite, Export as SQL
  3. Open the SQL file in a text editor
  4. Find & Replace the table prefix as necessary, to match the single site's wp-config ($table_prefix)
  5. Create a new WordPress site for the standalone single site
  6. Go into SequelPro, File > Import: The SQL file
  7. Also in SequelPro, under the “option_name” column header, change “wp_user_roles” to “YOUR_PREFIX_user_roles“. This fixes the error "Sorry, you are not allowed to access this page" when you visist /wp-admin (https://www.naijatechzone.com/wp-admin-login-error-sorry-you-are-not-allowed-to-access-this-page/)
  8. Use https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ to replace YOUR_OLD_DOMAIN_NAME with YOUR_NEW_DOMAIN_NAME
@dotherightthing
dotherightthing / bitbucket-password-required.md
Last active August 15, 2019 14:21
[Bitbucket Password Required] #git #bitbucket

Bitbucket Password Required

Created: 2017.07.04

When attempting to clone a website, the SSH passphrase is requested and rejected three times.

SourceTree Password Required prompt.

Password Required.