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 / providing-theme-translations.md
Created August 15, 2019 09:55
[Providing theme translations] #wordpress

Providing theme translations

Created: 2017.04.08

The Text Domain is defined in style.css:

/*
Theme Name: KB
Theme URI: http://kb.dotherightthing.co.nz
@dotherightthing
dotherightthing / arrow-functions.md
Created August 15, 2019 09:56
[Arrow functions] Arrow functions are anonymous functions useful for 'one-liners'. #es6 #javascript

Arrow functions

Created: 2017.04.09

They offer a more concise syntax, implicit returns and inherit the value of this from the parent scope.

Explicit returns

function

@dotherightthing
dotherightthing / contextual-search-results-in-wordpress.md
Last active August 15, 2019 09:58
[Contextual Search Results in WordPress] #wordpress #php

Contextual Search Results in WordPress

Created: 2017.04.09

A solution from Hacking at 0300

@dotherightthing
dotherightthing / optimising-parent-themes.md
Created August 15, 2019 09:59
[Optimising parent themes] How to Remove Styles, Scripts, and More from your WordPress Parent Theme. #wordpress
@dotherightthing
dotherightthing / writing-to-the-wordpress-debug-log.md
Last active August 15, 2019 10:01
[Writing to the WordPress debug.log] Sending your own output to the WordPress debug log. #wordpress
@dotherightthing
dotherightthing / move-the-excerpt-meta-box-above-the-editor.md
Last active August 15, 2019 10:03
[Move the excerpt meta box above the editor] #wordpress
@dotherightthing
dotherightthing / show-hidden-files.md
Created August 15, 2019 10:04
[Show Hidden Files] #commandline

Show Hidden Files

Created: 2017.04.14

MacOS

  1. defaults write com.apple.finder AppleShowAllFiles YES
  2. Hold the ‘Option/alt’ key, then right click on the Finder icon in the dock and click Relaunch.
@dotherightthing
dotherightthing / lossless-jpeg-compression.md
Created August 15, 2019 10:05
[Lossless JPEG compression] PageSpeed keeps telling me that my images are too big. #performance #images

Lossless JPEG compression

Created: 2017.04.07

EXIF

Many WordPress plugins claim to radically reduce file size, but there is often the catch that the EXIF data is stripped. This would mean that my maps wouldn't work anymore, unless I could store that GPS information somewhere before the optimisation took place.

SmushIt

@dotherightthing
dotherightthing / dynamic-hostname-plugin.md
Created August 15, 2019 10:07
[Dynamic Hostname plugin] #wordpress

Dynamic Hostname plugin

Created: 2017.04.06

This broke my custom fields when I implemented this on DBTH.

@dotherightthing
dotherightthing / debugging-error-500-in-wordpress.md
Last active August 15, 2019 10:13
[Debugging Error 500 in WordPress] How to debug a generic error message using the WordPress debug log. #wordpress

Debugging Error 500 in WordPress

Created: 2017.04.06

Background

Markdown is a great way to quickly author text documents. You can focus on the writing, almost ignoring petty necessities like formatting. It's not that sexy to look at, but it's super efficient to write and can be read by humans even in its raw format.

So it was the obvious choice when building out my KB theme for WordPress.