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 / node-exec.md
Last active August 30, 2019 10:20
[Node exec] #async #javascript #js #flowcontrol

Node exec

Comparing options, prior to refactoring the broken flow control in my Gulpfile.

Asynchronous, optionally runs a callback function.

Spawns a shell then executes the command within that shell, buffering any generated output. >

@dotherightthing
dotherightthing / migrating-from-gulp-391-to-402.md
Last active July 2, 2024 13:15
[Migrating a Gulpfile from Gulp 3.9.1 to 4.0.2] #gulp #es6 #babel

Migrating a Gulpfile from Gulp 3.9.1 to 4.0.2

Background

Via one of those mental leaps that one can only be achieved by working in two languages at once, I had found my way to Typescript.

I was excited about putting some rigour around my code. But as I sought to install the necessary dependencies, I started hitting versioning issues. I couldn't move forward with modern packages without addressing the dinosaur in the room, Gulp 3.9.1.

Migration Steps

@dotherightthing
dotherightthing / imperative-vs-declarative-programming.md
Last active August 27, 2019 06:00
[Imperative vs Declarative programming] #react #functional #javascript
@dotherightthing
dotherightthing / fix-iphone-home-button.md
Last active August 25, 2019 22:30
[Fix iPhone SE home button] #ios #touchid

Fix iPhone Home Button

From: Recalibrate Unresponsive Home Button

Open any general app like, Weather that comes pre-installed on your iPhone 6/6 Plus.

At the same time, press and hold the Power (sleep/wake) button until the “slide to power off” slider appears.

Release the power button and then press and hold the home button until the, “slide to power off” slider vanishes. >

@dotherightthing
dotherightthing / natural-docs-style-guide.md
Last active August 25, 2019 02:06
[Natural Docs Style guide] #documentation #js #javascript #php

Natural Docs style guide

Comment format for the best output.

The goal is to make the code self-documenting where possible:

  • use readable variable, function and class names
  • use descriptive URLs
  • give the documentation engine the right cues for good output

PHP

@dotherightthing
dotherightthing / open-files-in-sublime-text-3-from-the-command-line.md
Created August 23, 2019 13:42
[Open files in Sublime Text 3 from the command line] #shell #subl

Open files in Sublime Text 3 from the command line

1. Add a ~/bin directory to your path

$MAMP_PHP path is already in my path:

nano ~/.bash_profile
export PATH="$MAMP_PHP:$PATH"
@dotherightthing
dotherightthing / install-creativecloud-apps-on-an-external-drive.md
Created August 23, 2019 06:17
[Install CreativeCloud Apps on an external drive] #macos #adobe #hdd #space

Install Creative Cloud Apps on an external drive

From: Move Adobe programs to another HDD

  1. Open the Creative Cloud app
  2. Click the 3 dots next to your avatar > Preferences
  3. Change the Install Location

Note: This option only applies to future installs.

@dotherightthing
dotherightthing / changing-an-svgs-natural-dimensions.md
Last active August 22, 2019 02:42
[Changing an SVG's natural dimensions] #icons #github #artboard

Changing an SVG's natural dimensions

Background

I want to insert several 3rd party 'technology badges' into my Github README, with the following constraints:

  • I want to use SVGs, so the images look crisp on all screens
  • I'm limited to inserting the SVGs as <img>s
  • Github Flavoured Markdown doesn't provide any controls to resize my <img>s
  • I have no control over the page CSS
@dotherightthing
dotherightthing / installing-natural-docs-via-cli.md
Last active August 21, 2019 15:37
[Installing Natural Docs via the command line] #travis #gulp #bash #documentation #ci #macos
@dotherightthing
dotherightthing / emoji-vs-emoticons.md
Created August 21, 2019 12:20
[Emoji vs Emoticons] #icons #utf8 #design