Skip to content

Instantly share code, notes, and snippets.

Andy Vanee andyvanee

Block or report user

Report or block andyvanee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
andyvanee /
Last active Oct 29, 2019
Steps to run MySQL from a given data directory.

Sometimes it's nice to run MySQL (MariaDB) on your local machine in a completely contained environment. This outlines the minimum steps to make that happen.

  • Start with to get a root login.
  • Then create a non-root user with the following:

GRANT ALL PRIVILEGES ON *.* TO 'user-name'@'localhost' IDENTIFIED BY 'user-password';

  • Update data/my.cnf with the client username and password you just created.
  • You should probably also add the entire data directory to your .gitignore file.
andyvanee / SomeClass.php
Last active Oct 23, 2019
Demonstrating how to assign to private class members in PHP (not recommended)
View SomeClass.php
class SomeClass {
private $priv;
public $pub;
// This function demonstrates how to access and assign to private
// or undeclared class members using Closure::bindTo
function assignPrivate($obj, $key, $value) {
andyvanee / Dockerfile
Created Jan 31, 2019
My Current Dockerfile for building V8js
View Dockerfile
FROM debian:stretch-slim
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y git wget curl ca-certificates apt-transport-https gnupg1 sudo
RUN wget -q -O- | apt-key add - && \
echo "deb stretch main" | tee /etc/apt/sources.list.d/php.list && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
php7.2 php7.2-cli php7.2-common php7.2-opcache php7.2-curl php7.2-mbstring php7.2-mysql php7.2-zip php7.2-xml
andyvanee / MyHandler.php
Last active Nov 7, 2018
Using PHP-PM to run PHP code without a framework
View MyHandler.php
namespace MyApp;
use PHPPM\Bootstraps\ApplicationEnvironmentAwareInterface;
use Psr\Http\Message\ServerRequestInterface;
use RingCentral\Psr7\Response;
class MyHandler implements ApplicationEnvironmentAwareInterface {
public function __construct() {
andyvanee / .ssh_config
Last active Mar 19, 2020
Fix unix_listener too long for Unix domain socket
View .ssh_config
Host *
ControlPath ~/.ssh/control/%C
ControlMaster auto

Micromod Notes

Based on my experiments with

To compile mt files:

java -jar micromod-20160326.jar songs/

To compile the micromod-c mod player (this is what worked on my Mac anyway):

andyvanee /
Created Jun 10, 2017
PHP extensions for developing locally
#!/usr/bin/env sh
brew install php56 --with-imap
brew install php56-apcu php56-igbinary php56-imagick php56-memcache php56-memcached php56-tidy php56-zmq php56-mcrypt php56-event php56-libevent php56-mcrypt php56-intl php56-opcache
andyvanee /
Created Oct 11, 2016
Show a diff of two directory trees
#!/usr/bin/env bash
# Both find commands will output the file name without prefix as well as the file size
# `diff -u` outputs a diff format compatible with gist files with the .diff extension
# -printf does not work with OSX find unfortunately
diff -u <(find $1 -type f -printf '%s %P\n') <(find $2 -type f -printf '%s %P\n')
andyvanee / Makefile
Created Mar 21, 2016
Export docker-machine environment variables in a makefile
View Makefile
# Run `make ENVIRONMENT=machinename` to override the default
TLS_VERIFY=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_TLS_VERIFY=".*"' | cut -d\" -f2)
HOST=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_HOST=".*"' | cut -d\" -f2)
CERT_PATH=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_CERT_PATH=".*"' | cut -d\" -f2)
MACHINE_NAME=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_MACHINE_NAME=".*"' | cut -d\" -f2)
andyvanee / jquery-regex.js
Created Feb 23, 2016
Select by matching an ID with a regex
View jquery-regex.js
// Select by matching id with a regex
// eg: $('select:regex("box.*-layout")')
jQuery.expr[':'].regex = function(elem, index, args) {
var regex = new RegExp(args[3], 'i');
You can’t perform that action at this time.