Skip to content

Instantly share code, notes, and snippets.

View robmorgan's full-sized avatar
🇦🇺
Aussie! Aussie! Aussie!

Rob Morgan robmorgan

🇦🇺
Aussie! Aussie! Aussie!
View GitHub Profile
@robmorgan
robmorgan / tf-wrapper.sh
Created June 4, 2017 16:07
Terraform Multi Env Wrapper
#!/bin/bash
# This script acts as a wrapper to Terraform.
# Is Terraform available?
hash terraform 2>/dev/null || { echo >&2 "I require Terraform but it's not installed or in your path. Aborting."; exit 1; }
# All of the args are mandatory.
if [ $# -lt 3 ]; then
echo "Incorrect usage."
echo "$ ./tf-wrapper.sh plan production ami-XXXYYYZZ"
<?php
use Phinx\Migration\AbstractMigration;
class CreateUserTable extends AbstractMigration
{
public function change()
{
$users = $this->table('users');
$users->addColumn('username', 'string', array('limit' => 20))
@robmorgan
robmorgan / provider.tf
Created August 19, 2015 10:06
Use Terraform to create a droplet on Digital Ocean
variable "do_token" {}
variable "pub_key" {}
variable "pvt_key" {}
variable "ssh_fingerprint" {}
provider "digitalocean" {
token = "${var.do_token}"
}

Keybase proof

I hereby claim:

  • I am robmorgan on github.
  • I am rjm (https://keybase.io/rjm) on keybase.
  • I have a public key whose fingerprint is 59FA 8CBB F5B8 2094 5A52 A350 86B1 8B48 4530 108C

To claim this, I am signing this object:

@robmorgan
robmorgan / keybase.md
Created May 26, 2015 18:38
Keybase Identity

Keybase proof

I hereby claim:

  • I am robmorgan on github.
  • I am rjm (https://keybase.io/rjm) on keybase.
  • I have a public key whose fingerprint is C9F8 AC44 6E02 2633 DBCB 3BE6 A55C 18BE C248 ACFB

To claim this, I am signing this object:

@robmorgan
robmorgan / .gitconfig
Created December 4, 2013 08:24 — forked from gotar/.gitconfig
[user]
name = Oskar Szrajer
email = oskarszrajer@gmail.com
[alias]
br = branch
co = checkout
ci = commit
df = diff
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
public function change()
{
$table = $this->table('continents', array('id' => false, 'primary_key' => array('name', 'country_id')));
$table->addColumn('name', 'string')
->addColumn('country_id', 'integer')
->addForeignKey('country_id', 'country', 'country_id', $options = array())
->save();
}
<?php
use Phinx\Migration\AbstractMigration;
class CreatePostsTable extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
<?php
use Phinx\Migration\AbstractMigration;
class ExampleMigration extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
@robmorgan
robmorgan / composer.json
Created October 20, 2012 22:33
Guestbook Composer File
{
"require": {
"robmorgan/phinx": "*"
}
}