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 / fix-unable-to-create-directory-error.md
Created August 15, 2019 05:45
[Fix Unable to create directory Error] #wordpress
@dotherightthing
dotherightthing / implementing-a-code-freeze.md
Created August 15, 2019 05:46
[Implementing a Code Freeze] #wordpress
@dotherightthing
dotherightthing / unlock-android-phone-without-passcode.md
Created August 15, 2019 05:47
[Unlock Android phone without passcode] #android

Unlock Android phone without passcode

Created: 2017.05.18

With my Samsung A3 out of action, I turned to my 3rd backup phone, a Miui Redmi 2. But I couldn't remember the passcode pattern.

Tried but failed

  • Minimal ADB Fastboot 1.4.2 (Windows)
  • XiaoMiFlash (Windows)
@dotherightthing
dotherightthing / unlock-android-phone-via-usb.md
Created August 15, 2019 05:48
[Unlock Android phone via USB] #android

Unlock Android phone via USB

Created: 2017.05.14

Drenched during my latest cycle tour, my Samsung SM-A300F/DS no longer responded to touch. Repair shops have a nasty habit of wiping data - how could I unlock the phone and download my precious travel pics first?

Initial attempts

Dr Fone

@dotherightthing
dotherightthing / documenting-required-and-optional-params.md
Created August 15, 2019 05:49
[Documenting required and optional @params] #php #documentation

Documenting required and optional @params

Created: 2017.04.24

Using phpDocumentor.

Strictly speaking, PHP doesn't know "optional parameters", but parameters with default values, that can be omitted when the function or method is called. What the documentation tries to tell you is that you should mention it yourself like:

@dotherightthing
dotherightthing / extract.md
Created August 15, 2019 05:51
[extract()] PHP's extract() function dynamically creates variables, making debugging harder. #php #wordpress

extract()

Created: 2017.04.19

PHP's extract() function dynamically creates variables, making debugging harder.

extract() creates a variable for each key in an associative array, checking that it is a valid variable name, and that it does not collide with any existing variables.

Using extract()

@dotherightthing
dotherightthing / optimising-using-chrome-dev-tools.md
Created August 15, 2019 05:52
[Optimising using Chrome Dev Tools] Notes from a free Udacity course. #performance

Optimising using Chrome Dev Tools

Created: 2017.04.19

Notes from a free Udacity course.

Website Performance Optimisation Testing

The version of Chrome Dev Tools used in the video appears to differ, so YMMV

-> vs =>

=>

The double arrow operator is used to access the value of an array item.

<?php
$myArray = array(
 0 =&gt; 'Big'
@dotherightthing
dotherightthing / complex-curly-syntax.md
Created August 15, 2019 05:55
[Complex (curly) syntax] Useful for string concatenation. #php
@dotherightthing
dotherightthing / inspect-plugin-data-in-database.md
Created August 15, 2019 06:37
[Inspect plugin data in database] #wordpress

Inspect plugin data in database

Created: 2017.04.18

SELECT * FROM [optionsTableName] where option_name = '[pluginName]'