Skip to content

Instantly share code, notes, and snippets.

Rob Morgan robmorgan

View GitHub Profile
@robmorgan
robmorgan / tf-wrapper.sh
Created Jun 4, 2017
Terraform Multi Env Wrapper
View tf-wrapper.sh
#!/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"
View 20151129162222_create_user_table.php
<?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 Aug 19, 2015
Use Terraform to create a droplet on Digital Ocean
View provider.tf
variable "do_token" {}
variable "pub_key" {}
variable "pvt_key" {}
variable "ssh_fingerprint" {}
provider "digitalocean" {
token = "${var.do_token}"
}
View keybase.md

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
Keybase Identity
View keybase.md

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:

View .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
View gist:7704544
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();
}
View CreatePostsTable.php
<?php
use Phinx\Migration\AbstractMigration;
class CreatePostsTable extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
View 20130406160342_example_migration.php
<?php
use Phinx\Migration\AbstractMigration;
class ExampleMigration extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
@robmorgan
robmorgan / composer.json
Created Oct 20, 2012
Guestbook Composer File
View composer.json
{
"require": {
"robmorgan/phinx": "*"
}
}
You can’t perform that action at this time.