Skip to content

Instantly share code, notes, and snippets.

View johnallen3d's full-sized avatar

John Allen johnallen3d

View GitHub Profile
@johnallen3d
johnallen3d / heroku-ci-cd.md
Created April 12, 2018 14:20
Overview of key Heroku features and CI/CD
@johnallen3d
johnallen3d / docker-compose.yml
Created March 26, 2018 21:29
Basic Kong + Postgres setup in Docker (compose)
version: '2.3'
services:
web:
image: kong:latest
links:
- db
environment:
- "KONG_DATABASE=postgres"
- "KONG_PG_HOST=db"
- "KONG_PROXY_ACCESS_LOG=/dev/stdout"

Continuous Integration (CI) and
Continuous Delivery (CD)

Background reading

ci-cd-illustration

CI

Regular automated builds and testing of a code base. We are using CircleCI to facilitate CI (and sometimes CD, see Container Runtime).

@johnallen3d
johnallen3d / README.md
Last active January 23, 2018 15:56
nib plugins talk

nib plugins

nib

  • nib is a convenience wrapper for docker-compose
  • originally designed with Ruby/Rails developers in mind but has features that would be helpful for any developer

Plugin Architecture

nib is pluggable via additional gems. The plugin system is loosely based on that of minitest extensions. There are three requirements for a nib plugin:

@johnallen3d
johnallen3d / keybase.md
Created August 4, 2016 19:32
Keybase proof

Keybase proof

I hereby claim:

  • I am johnallen3d on github.
  • I am jallen7usa (https://keybase.io/jallen7usa) on keybase.
  • I have a public key ASDCDcjmAy4Vb3T0p_HRhEjrt9loW4vL1kDaNk0C34o4hAo

To claim this, I am signing this object:

@johnallen3d
johnallen3d / app-controllers-application_controller.rb
Created February 16, 2016 21:24
Simplest implementation of the OmniAuth developer strategy (OmniAuth::Strategies::Developer). http://www.rubydoc.info/github/intridea/omniauth/OmniAuth/Strategies/Developer
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
def current_user=(user)
session[:user_id] = user.uid
end
def current_user
@johnallen3d
johnallen3d / elastigroup-group-create.sh
Created January 8, 2016 17:36
Create an elastigroup cluster on spotinst.com
#!/bin/bash
PASSWORD=$1
if [[ $1 = '' ]]; then
echo Please provide your spotinst password
exit 1
fi
echo $PASSWORD
@johnallen3d
johnallen3d / -introduction.md
Last active January 4, 2016 22:12
Technekes Rubocop Introduction and Instructions

A goal of the engineering team is to improve code quality and consistancy. One of the simplest ways to head in that direction is to start (or further) the use of RuboCop. If you're not farmiliar, RuboCop is a static Ruby code analyzer that use a common Ruby Style Guide as it's basis for enforcing standards. Once installed (it's just a gem) the RuboCop binary can be used as part of our development workflow to help enforce standards and consistancy on a change by change basis (with the help of Guard for example).

Realizing that some projects currently have a version of RuboCop setup and some do not at all we would like to take a gradual approach to introducing RuboCop. The idea would be to get RuboCop installed on an existing code base and then disable all of the cops that are not passing at the outset. From there we would spend a little time each week (or as you're naturally editing an existing piece of code) bringing things

Process Substitution Error in IRB

simple example of process substitution in shell (bash)

> echo <(true)
/dev/fd/11

now with Ruby (IRB) - note: Ruby is shelling out to /bin/sh not /bin/bash

@johnallen3d
johnallen3d / boot2docker-to-docker-machine.sh
Last active August 28, 2015 19:28
Script to migrate from boot2docker to docker-machine
# update homebrew
brew update
# install cask (if necessary)
brew install caskroom/cask/brew-cask
# or update cask
brew update cask
# create a dev machine that is a copy of the boot2docker image