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 / acf-widgets.md
Last active August 15, 2019 06:40
[ACF Widgets] #wordpress

ACF Widgets

Created: 2017.04.26

ACF fields are typically populated via page-level meta boxes. But, as of version 5, it is now possible to build ACF Widgets.

The catch is that Widgets are only supported from version 5.

@dotherightthing
dotherightthing / outputting-a-raw-excerpt.md
Last active August 15, 2019 06:43
[Outputting a raw excerpt] How to remove those pesky paragraph tags. #wordpress

Outputting a raw excerpt

Created: 2017.04.17

How to remove those pesky paragraph tags.

The excerpt doesn't allow any HTML formatting, yet it is usually output wrapped in <p> tags:

Formatted

@dotherightthing
dotherightthing / crud.md
Last active August 15, 2019 06:45
[CRUD] #php

CRUD

Created: 2017.04.18

Acronym to describe working with 'persistent storage'.

  • Create
  • Read
  • Update
  • Delete
@dotherightthing
dotherightthing / custom-theme-requirements.md
Last active August 15, 2019 07:16
[Custom theme requirements] Custom themes are a blank canvas. Well, sort of. #wordpress

Custom theme requirements

Created: 2017.04.14

Requirements

Theoretically a custom theme could fulfil any niche need, and therefore deviate very far from the typical idea of the WordPress 'blog'.

At least, that's what I thought when creating a custom theme to manage my internal knowledgebase.

@dotherightthing
dotherightthing / moving-to-the-cloud-or-not.md
Created August 15, 2019 08:39
[Moving to the cloud, or not..] #cloudstorage #images

Moving to the cloud, or not..

Since devoting more time to writing up my travel journals, I've become increasingly aware of the burden that are my travel photos.

MacOS + Dropbox

My photos start their life on a smartphone or a Canon G1x. From their they're transferred to Dropbox, and then synced back to my laptop.

I can view images in-folder or using Photos. I don't really like the MacOS solution, it doesn't have great organisation, it's really slow to sync between devices, it doesn't work on Android, and iCloud is expensive.

@dotherightthing
dotherightthing / web-performance.md
Created August 15, 2019 08:41
[Web performance] #performance

Web performance

Created: 2017.04.15

  • focus on the critical 3%, make the distinction between critical and non-critical
  • mature optimization based on experience and benchmarking
  • middle-end as a buffer: resources, architecture, communication, data exchange contract with back-end operating as a headless stateful API
  • be aware that you are developing on souped-up hardware
  • hands on optimisations, rather than blindly using tools
  • avoid more than one copy of data-validation rules
@dotherightthing
dotherightthing / print_r-vs-var_dump.md
Created August 15, 2019 08:43
[print_r vs var_dump] #php

print_r vs var_dump

Created: 2017.04.18

I've always used print_r, but some tutorials use var_dump.

The var_dump function displays structured information about variables/expressions including its type and value. Arrays are explored recursively with values indented to show structure. It also shows which array values and object properties are references.

@dotherightthing
dotherightthing / soundcloud-api.md
Created August 15, 2019 08:44
[Soundcloud API] Resurrecting panoramica.co.nz. #soundcloud #api
@dotherightthing
dotherightthing / ninja-forms.md
Last active August 15, 2019 08:54
[Ninja Forms] Easy to create, not particularly accessible. #wordpress

Ninja Forms

Created: 2017.04.17

Upwork clients often ask for form customisations. They two main systems they mention are Ninja Forms and Gravity Forms.

Both Ninja Forms and Gravity Forms allow you to create forms with required fields, make use of field validation, and have the ability to perform calculations based on the data that the user has entered. Unlike Ninja Forms, Gravity Forms isn’t available in a free version. Instead, you’ll need to choose from one of the three paid options

@dotherightthing
dotherightthing / critical-path.md
Created August 15, 2019 08:55
[Critical Path] HTML is the only critical component and everything else is sugar. #performance

Critical Path

Created: 2017.04.14

Stefanov talks about what is critical when viewing a page. He concludes that the HTML is the only critical component and everything else is sugar.

Unfortunately, many sites load the `` up with CSS, with the following results: