Skip to content

Instantly share code, notes, and snippets.

Jon Bake jonmbake

Block or report user

Report or block jonmbake

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
@jonmbake
jonmbake / Vagrantfile
Created Aug 6, 2019
Vagrantfile for Local Provisioning of Matomo on Ubuntu 18.04
View Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.provision :ansible_local do |ansible|
ansible.limit = 'local'
ansible.inventory_path = 'hosts'
ansible.playbook = 'local.yml'
end
@jonmbake
jonmbake / local.yml
Last active Aug 8, 2019
Ansible Playbook for Local Provisioning of Matomo on Ubuntu 18.04
View local.yml
- hosts: local
connection: local
become: yes
become_user: root
vars_files:
- local_vars.yml
pre_tasks:
- raw: apt -y update && apt install -y python-apt
tasks:
- name: Install Apache, PHP, MySQL, Unzip
@jonmbake
jonmbake / Dockerfile
Created Aug 29, 2018
AWS CodeBuild Ruby 2.4.0 Postgres 9.4 Dockerfile
View Dockerfile
FROM ubuntu:14.04.5
ENV DOCKER_BUCKET="download.docker.com" \
DOCKER_VERSION="17.09.0-ce" \
DOCKER_CHANNEL="stable" \
DOCKER_SHA256="a9e90a73c3cdfbf238f148e1ec0eaff5eb181f92f35bdd938fd7dab18e1c4647" \
DIND_COMMIT="3b5fac462d21ca164b3778647420016315289034" \
DOCKER_COMPOSE_VERSION="1.21.2" \
GITVERSION_VERSION="3.6.5"
@jonmbake
jonmbake / building_enzyme_for_amd.md
Last active Jul 29, 2018
Building Enzyme for Use in Legacy Module Loading Systems (AMD e.g. RequireJS, SES, UMD)
View building_enzyme_for_amd.md

This describes how to build enzyme as a UMD (Universal Module Definition) module so it can be used in systems with legacy module loaders like RequireJS.

Browserify with the --standalone option will be used to build the standalone Enzyme UMD module. This is a good post describing Browserify's --standalone option: http://www.forbeslindesay.co.uk/post/46324645400/standalone-browserify-builds.

  1. Install npm dependencies
npm install --save-dev browserify
npm install --save-dev enzyme
npm install --save-dev react
@jonmbake
jonmbake / gist:2eaa48f71b5f95a12ba3
Last active Dec 21, 2015
Creating a Checkstyle-Tester DIFF-REPORT steps taken
View gist:2eaa48f71b5f95a12ba3
  1. Did a clean/install of checkstyle before my change
cd ~/projects/git/checkstyle
git checkout c0a664c25194ef7be3b59ce200a9fcd88fbc5c2d
mvn clean install
  1. Cloned checkstyle-contribution and cd'ed cd ~/projects/git/checkstyle-contribution/
  2. Uncommented all projects in projects-to-test-on.properties
@jonmbake
jonmbake / sendmail.php
Created Dec 19, 2015
Without env. variables and without SMTP authentication
View sendmail.php
?php
/**
* Sets error header and json error message response.
*
* @param String $messsage error message of response
* @return void
*/
function errorResponse ($messsage) {
header('HTTP/1.1 500 Internal Server Error');
die(json_encode(array('message' => $messsage)));
@jonmbake
jonmbake / contact-form.js
Created Oct 4, 2015
Passing in Global jQuery Variable to contact-form's self executing function
View contact-form.js
(function ($) {
var contactFormUtils = {
isValidEmail: function (email) {
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
return regex.test(email);
},
clearErrors: function () {
$('#emailAlert').remove();
$('#feedbackForm .help-block').hide();
$('#feedbackForm .form-group').removeClass('has-error');
@jonmbake
jonmbake / contact-form.js
Last active Sep 29, 2015
Navigate to home page on sucess
View contact-form.js
(function () {
var contactFormUtils = {
isValidEmail: function (email) {
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
return regex.test(email);
},
clearErrors: function () {
$('#emailAlert').remove();
$('#feedbackForm .help-block').hide();
$('#feedbackForm .form-group').removeClass('has-error');
@jonmbake
jonmbake / gist:0e5b175a72ad9ba64167
Last active Jan 27, 2018
Example of sendmail.php w/o environment variables
View gist:0e5b175a72ad9ba64167
<?php
/**
* Sets error header and json error message response.
*
* @param String $messsage error message of response
* @return void
*/
function errorResponse ($messsage) {
header('HTTP/1.1 500 Internal Server Error');
die(json_encode(array('message' => $messsage)));
@jonmbake
jonmbake / gist:7b40d085b1b9f367e7a1
Last active Aug 29, 2015
Rails/Angular Pre-Commit Hook
View gist:7b40d085b1b9f367e7a1
#!/usr/bin/env bash
#
# Rails/Angular pre commit hook.
#
# This should live in your rails config folder and a symbolic link should be created from .git/hooks/ to this file. You
# should also set the FRONT_END_PATH/BACK_END_PATH env. variable so the script knows where to pull in the front-end code from.
#
# This pre-commit hook does the following:
# 1. Runs rspec (and fails the commit if any tests fail)
# 2. Runs grunts default task on the Front-End project (which should minify and run karam tests). Fails the commit if any tests fail.
You can’t perform that action at this time.