Skip to content

Instantly share code, notes, and snippets.

View karlhorky's full-sized avatar

Karl Horky karlhorky

View GitHub Profile
  1. Set up a docker-compose.yaml file (file content at the bottom of this page).

  2. Also create a data/mysql folder in your project.

  3. In order to set up a volume for MySQL in Docker Toolbox, we will need a VirtualBox Shared Folder, just like mentioned in Fixing Volumes in Docker Toolbox.

    VirtualBox by default has a c/Users Shared Folder that we can use for this (as long as your project is within C:\Users. Verify that this shared folder is set up properly:

    Capture

  4. Add a new volume to the mydatabase service in the docker-compose.yaml for the database files. Because we are using docker-toolbox and VirtualBox, we need an absolute path, starting with //c/:

    volumes:
  • //c/Users/your_username/projects/wordpress-docker-stack/data/mysql:/var/lib/mysql
@karlhorky
karlhorky / test.md
Last active September 21, 2019 08:55
Table Row Width
@karlhorky
karlhorky / .bashrc
Created September 3, 2019 19:37
Bash Git Aliases
# Git Aliases (sorted alphabetically with some inculsive functions)
# Adapted from oh-my-zsh git alias plugin. "compdef" is a Z shell autocompletion function, disabled throughout where applicable.
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
alias gb='git branch'
@karlhorky
karlhorky / engine-ua-sniffer.js
Created July 10, 2019 16:01 — forked from domenic/engine-ua-sniffer.js
Rendering engine UA sniffer
// This is a minimal UA sniffer, that only cares about the rendering/JS engine
// name and version, which should be enough to do feature discrimination and
// differential code loading.
//
// This is distinct from things like https://www.npmjs.com/package/ua-parser-js
// which distinguish between different branded browsers that use the same rendering
// engine. That sort of distinction is maybe useful for analytics purposes, but
// for differential code loading it is overcomplicated.
//
// This is meant to demonstrate that UA sniffing is not really that hard if you're
import React, { useState, useEffect } from "react";
import "./packages/combobox/styles.css";
import {
Combobox,
ComboboxInput,
ComboboxList,
ComboboxOption,
ComboboxPopup
} from "./packages/combobox/index";
@karlhorky
karlhorky / fetch-with-timeout.js
Created January 26, 2019 13:58
Fetch with Timeout
// Fetch with timeout
// Source: https://github.com/whatwg/fetch/issues/179#issuecomment-457698748
const networkTimeoutError = new Error('Network request timeout')
function getTimeout({ timeout }) {
if (timeout && timeout.constructor === Promise) {
return timeout
}
if (typeof timeout === 'number') {