Skip to content

Instantly share code, notes, and snippets.

@matthewjackowski
matthewjackowski / octopress-vagrant-chef.md
Created February 9, 2014 13:32
Octopress Vagrant - Chef setup

I really love Octopress (http://octopress.org/). The only problem is setting up a functional Ruby environment. I always seem to spend more time with Ruby than the project itself. So I built a vagrant/chef setup for it. Before I go too far...I assume you have the following setup (this is a non-trivial task, thats covered better elsewhere): Virtualbox, Vagrant, Vagrant Plugins (vbguest, omnibus, berkshelf)

Ok let's jump into some code for the Berkshelf:

cookbook "dmg", "<= 2.0.6"
cookbook "git"
cookbook "curl"
cookbook "rvm", git: 'https://github.com/fnichol/chef-rvm.git'
@matthewjackowski
matthewjackowski / ghost-vagrant-chef.md
Last active August 29, 2015 13:56
Ghost Vagrant Setup - Similar to what the project has already except provisioning using Chef

Running Ghost Blog with vagrant - Chef. My usual disclaimer, I assume you already have Vagrant and Virtual box setup. And Vagrant plugins for vbguest, omnibus and berkshelf.

Ghost requires both Ruby and Node and maintains Git submodule dependencies, which quite frankly turns it into a configuration nightmare. We'll use fnichol's excellent rvm cookbook, and the standard nodejs.

Here's my Berkfile with the cookbooks we'll be using:

cookbook "dmg", "<= 2.0.6"
cookbook "git"
cookbook "curl"
cookbook "rvm", git: 'https://github.com/fnichol/chef-rvm.git'
@matthewjackowski
matthewjackowski / play-angular-vagrant.md
Last active August 29, 2015 13:56
Play 2 and Angular on a Vagrant

So here is a Gist for what might just be the mother of all framework stacks. How about a little MVC with your MVC? I think there are some really good reason to want to do this. But be warned its not for the faint of heart. The easy part is getting the basics installed here's my Berks:

cookbook "dmg", "<= 2.0.6"
cookbook "git"
cookbook "curl"
cookbook "nodejs"
cookbook "npm"
cookbook "java"
cookbook "play", git: 'https://github.com/njin-fr/play2.git'
@matthewjackowski
matthewjackowski / posgresql-on-a-vagrant.md
Last active August 29, 2015 14:07
Postgresql on a Vagrant

For this Gist we'll be using Chef Kitchen: https://docs.getchef.com/kitchen.html

Which is a convient way to wrap together chef-solo, berkshelf, and vagrant.

Assuming a basic setup of Ruby to run Kitchen(I use rbenv and bundler to make life easier, but this might lead to some righteous Ruby debate...so foregoing here).

Enough preamble, here is my Gemfile:

source 'https://rubygems.org'
@matthewjackowski
matthewjackowski / install-wp-tests.sh
Last active May 8, 2022 10:45
Install Wordpress and Tests
#!/usr/bin/env bash
##
# This script installs wordpress for phpunit tests and rspec integration tests
##
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
DIR=$(dirname ${DIR})
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
exit 1
@matthewjackowski
matthewjackowski / wp-plugin-deploy.sh
Last active July 25, 2016 21:59
Deploy to plugin repo
#!/bin/bash
echo "$PLUGIN_VERSION"
rm -rf ./build
mkdir ./build
cd build
svn co https://plugins.svn.wordpress.org/transifex-live-integration
cd ./transifex-live-integration
rm -f ./trunk/*
# copy files
cp ../../index.php ./trunk
@matthewjackowski
matthewjackowski / travisci-apache
Last active October 5, 2015 07:38
Apache conf for TravisCI
<VirtualHost *:80>
ServerName wptest.localhost
DocumentRoot %TRAVIS_BUILD_DIR%
<Directory "%TRAVIS_BUILD_DIR%">
Options FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order deny,allow
Allow from all
RewriteEngine On
@matthewjackowski
matthewjackowski / wp-cli.yml
Created October 3, 2015 22:05
WP CLI global config
apache_modules:
- mod_rewrite
@matthewjackowski
matthewjackowski / Demo-commands
Last active October 28, 2015 20:03
Commands for Javascript Demo
npm install connect serve-static
node server.js
var s = angular.element($0).scope();
s.changeLanguage('es');
@matthewjackowski
matthewjackowski / angular-translate-basic-setup.js
Last active February 13, 2017 10:47
Basic App Setup for Angular Translate
var translations = {
"All": "All",
"Active": "Active",
"Completed": "Completed",
"Clear_Completed": "Clear_Completed"
};
var estranslations = {};
app.config(['$translateProvider', function ($translateProvider) {