Skip to content

Instantly share code, notes, and snippets.

View mdwheele's full-sized avatar

Dustin Wheeler mdwheele

View GitHub Profile
# Install VirtualBox
brew install --cask virtualbox

# Install Docker (CLI), Docker Machine, and Docker Compose
brew install docker docker-machine docker-compose

# Use Docker Machine to create a VirtualBox VM that runs Docker
docker-machine create --driver virtualbox default

🔥 This is a work in progress moving a bunch of notes to one place so I don't have to do this from memory ever again...

Versions Tested

# Local (MacOS Catalina)
gpg (GnuPG) 2.2.30 
OpenSSH_8.1p1, LibreSSL 2.7.3

# Remote (Ubuntu 20.04 LTS)
@mdwheele
mdwheele / App.vue
Last active July 24, 2020 13:56
A renderless Stepper component
<template>
<Stepper v-model="step" v-slot="{ title, description, total, progress, next, prev, hasNext, hasPrev, nextStep, prevStep }">
<p>There are {{ total }} steps.</p>
<p>You are {{ progress }}% complete.</p>
<h1>{{ title }}</h1>
<p>{{ description }}</p>
<Step title="First" description="The first step...">
1
@mdwheele
mdwheele / Paginate.vue
Created June 18, 2020 19:25
Example of a renderless component for implementing Pagination
<script>
/**
* This is a "renderless component". What that means is that it has no presentational
* aspect to it at all. It's really just about behaviour and state management.
*
* It receives a list of whatever you want via :items and allows the consumer to set
* a maximum page size via :perPage. Everything from that point forward is under control
* of the parent of Paginate. You provide your own slot contents and destructure slot props
* to get the current page or interact with pagination.
*/
@mdwheele
mdwheele / bad.js
Last active June 9, 2020 14:19
Don't filter like this
const produce = ['Apple', 'Potato', 'Banana', 'Cucumber']
// Using a temporary value to build up our result.
const fruits = []
// Bad: Using filter that has a side-effect (non-pure function).
produce.filter(p => {
if (['Apple', 'Banana'].includes(p)) {
fruits.push(p)
}
@mdwheele
mdwheele / .gitignore
Last active May 13, 2020 19:20
Bootstrap for PHP Projects
/.idea
/node_modules
/vendor
composer.phar
composer.lock
.DS_Store
Thumbs.db
npm-debug.log
phpunit.xml
@mdwheele
mdwheele / yosemite-sound-issues.md
Created October 22, 2014 00:25
Fix Yosemite Bluetooth Sound Issues
  1. Run the following in your terminal.
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 80

Benchmark

This is a benchmark for https://wiki.php.net/rfc/friend-classes that attempts to approximate performance delta between master and feature/friend-classes-poc.

Both benchmarks execute a script that attempts access of a target property 100,000 times. We sample 100 executions of this script and average to compare.

Compilation

make clean
@mdwheele
mdwheele / proposal.md
Last active January 3, 2018 20:25
Discussing how to make DDD easier to learn.

Edit: A bit of context as more than expected are happening upon the gist.

This is in response to a conversation between a few engineers I consider experts in their respective fields:

  • Jeffrey Way (of Laracasts) as a technical educator aiming to investigate exposing newcomers to DDD in an easier-to-digest/grasp way.
  • Konstantine Kudryashov (Behat, phpSpec, Inviqa) as a BDD consultant
  • Mathias Verraes (dddinphp.org, http://verraes.net/) as a significant DDD resource and independent consultant.

Additional context can be sought reading backwards from https://twitter.com/mdwheele/status/527233999744557056. The stream is a bit broken, but the general gist/context is there.

@mdwheele
mdwheele / .gitmessage
Created December 8, 2015 18:49
Use this Git commit message template to write better commit messages.
Replace this line with imperative summary
An awesome description describing WHY this work over HOW/WHAT it does.
The diff attached to commit should describe implementation (HOW)
well-enough.
# [Ticket #12]
#-----------------------------------------------@----------------------#
#