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 / sourcetree-cannot-connect-to-bitbucket-cloud.md
Created August 15, 2019 14:07
[SourceTree cannot connect to BitBucket cloud] #bitbucket
@dotherightthing
dotherightthing / invisible-recaptcha.md
Last active August 15, 2019 14:05
[Invisible reCAPTCHA] #security #ux

Invisible reCAPTCHA

Created: 2017.06.02

When signing up for an API key today, I noticed that Google had added an option for "Invisible reCAPTCHA"..

reCAPTCHA type selection screen.

@dotherightthing
dotherightthing / passing-a-custom-variable-to-a-filter-or-action.md
Created August 15, 2019 13:58
[Passing a custom variable to a filter or action] #wordpress

Passing a custom variable to a filter or action

Created: ?

I'd like to create a reusable function to register/replace permalink placeholders.

add_filter('post_link', 'wpdtrt_replace_taxonomy_permalink_placeholders', 10, 3);

wpdtrt_replace_taxonomy_permalink_placeholders($permalink, $post_id, $leavename) {
@dotherightthing
dotherightthing / when-debug-log-fails.md
Created August 15, 2019 13:56
[When debug.log fails] Beyond debug.log. #wordpress

When debug.log fails

Created 2017.04.14

Today I had a white page after switching themes.

debug.log didn't show any errors.

Renaming plugins to pluginsX caused the (PHP syntax) error to be logged to debug.log.

@dotherightthing
dotherightthing / reset-wordpress-admin-password.md
Last active August 15, 2019 13:51
[Reset WordPress Admin password] #wordpress
@dotherightthing
dotherightthing / advanced-custom-fields.md
Created August 15, 2019 13:49
[Advanced Custom Fields] #wordpress

Advanced Custom Fields

Created: 2017.03.27

Introduction

Advanced Custom Fields is a plugin that extends the custom fields functionality built into WordPress. It adds different kinds of fields for example. It is fast to work with because all the supporting code is hidden and you are essentially creating configuration objects.

Authoring options

@dotherightthing
dotherightthing / hardware-acceleration.md
Last active August 15, 2019 13:47
[Hardware Acceleration] #css

Hardware Acceleration

Created: 2017.03.27

Background

I was debugging a layout issue for an Upwork client.

An article UI Repaint Issue on Chrome piqued my interest and led me on a Deep Dive into Hardware Acceleration.

@dotherightthing
dotherightthing / add-a-css-class-to-the-body.md
Created August 15, 2019 12:57
[Add a CSS class to the body] #wordpress

Add a CSS class to the body

Created: 2017.03.26

To inherit styles, use the same classnames as used in the parent theme. e.g. no-sidebar

add_filter('body_class','SITENAME__class_names');
function SITENAME__class_names($classes) {
 $CUSTOM_FIELD_VALUE = get_field( 'CUSTOM_FIELD_NAME' );
@dotherightthing
dotherightthing / online-development-courses.md
Created August 15, 2019 12:51
[Online development courses] My impressions. #education

Online development courses

Created: 2017.04.20

Treehouse

I completed my first Treehouse course recently. The resulting code is functional, but, as I read more of the official WordPress documentation, I realise that a lot of the code is not best-practice. In addition, the forums do not appear to be monitored by staff. The overall impression is that the course content is old and not maintained. Therefore I'm not ready to pay a monthly fee for content of this quality.