Skip to content

Instantly share code, notes, and snippets.

@cullylarson
cullylarson / Vagrantfile
Last active November 26, 2015 00:12
Vagrant Ubuntu 12.04.5 LTS (Precise Pangolin) x64
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/precise64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision "shell", path: "./vagrant-provision.sh"
end
@cullylarson
cullylarson / Vagrantfile
Last active January 31, 2016 00:54
Vagrant CentOS 6.6
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "puppetlabs/centos-6.6-64-nocm"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision "shell", path: "./vagrant-provision.sh"
end
{
"rules": {
"indent": [ 2, 4 ],
"quotes": [ 2, "double" ],
"linebreak-style": [ 2, "unix" ],
"semi": [ 2, "never" ],
"comma-dangle": [ 0, "always-multiline" ]
},
"env": {
"es6": true,
@cullylarson
cullylarson / gulpfile-sass.js
Last active December 9, 2015 00:54
Gulpfile snippet for SASS and Bootstrap
"use strict"
require("babel-polyfill")
const argv = require('minimist')(process.argv.slice(2))
import gulp from 'gulp'
import gutil from 'gulp-util'
import sass from 'gulp-sass'
import concat from 'gulp-concat'
import gulpif from 'gulp-if'
import autoprefixer from 'gulp-autoprefixer'
@cullylarson
cullylarson / gulpfile-images.js
Last active December 9, 2015 00:54
Gulpfile snippet for processing images
import gulp from 'gulp'
import gutil from 'gulp-util'
import plumber from 'gulp-plumber'
import os from 'os'
import batch from 'gulp-batch'
import imagemin from 'gulp-imagemin'
import pngquant from 'imagemin-pngquant'
import changed from 'gulp-changed'
const plumberh = function (err) {

Addresses something like this:

Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   4.3.10
VBoxService inside the vm claims: 5.0.10

Option 1

@cullylarson
cullylarson / database-backup-with-rotation.sh
Last active March 2, 2016 00:59
Backup Database, with Rotation
#!/bin/bash
if [[ -z "$1" ]]; then exit 1; fi
if [[ -z "$2" ]]; then exit 1; fi
TASK=$1
# Backup folders
BK_BASE=/path/to/backup/folder
BK_DAILY=$BK_BASE/daily
@cullylarson
cullylarson / WordpressAsDependency.md
Last active July 13, 2021 08:37
Installing Wordpress as a dependency

Wordpress as a Dependency

How to install Wordpress as a dependency in your project, without including the WP install in version control.

Rationale

In the spirit of The Twelve Factor App, we want to "explicitly declare and isolate dependencies". Wordpress doesn't really promote this idea out of the box, so we have jump through a few hoops to do it. This document describes a simple method to include Wordpress as a dependency in this way.

General Idea

@cullylarson
cullylarson / vagrant-local-email.sh
Last active March 14, 2017 11:20
Catch all emails sent on a dev box and deliver them to the 'vagrant' user's mailbox
#
# Many apps send email. In a dev environment, we generally don't want those emails
# to get out. However, we still want our app to think it's sending mail and we want
# to verify that emails are being sent, with the correct content and to the correct
# recipients.
#
# This setup solves that problem by delivering all out-bound emails to the local
# "vagrant" user's mailbox. You can then read the emails using the "mutt" command.
#
# Most if this is copied from:

Convenient k8s/Docker/gcloud Commands

Commands that are useful for doing stuff on Google Container Engine

Setup

$ gcloud config set project PROJECT_ID
$ gcloud config set compute/zone ZONE_NAME
$ gcloud container clusters list