Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Heijmans parabuzzle

View GitHub Profile
View Dockerfile
# This docker file sets up the base container for other applications
#
# https://docs.docker.com/reference/builder/
#
# Author:: Michael Heijmans (mailto:parabuzzle@gmail.com)
# Copyright:: Copyright (c) 2016 Michael Heijmans
# License:: MIT
FROM parabuzzle/ruby:2.3.1
View gist:77ded2ae4b2c4a619d5ea87495105374
# This docker file sets up the base container for other applications
#
# https://docs.docker.com/reference/builder/
#
# Author:: Michael Heijmans (mailto:parabuzzle@gmail.com)
# Copyright:: Copyright (c) 2016 Michael Heijmans
# License:: MIT
FROM parabuzzle/ruby:2.3.1
View with_app_env
#!/usr/bin/env bash
# Wraps a command in the warm and cozy shell we want
#
# Author:: Michael Heijmans (mailto:parabuzzle@gmail.com)
# Copyright:: Copyright (c) 2016 Michael Heijmans
# License:: MIT
set -e
echo -e "Establishing the environment for $APP_ENV from $VAULT_ADDR"
View vaultenv
#!/usr/bin/env ruby
# Read an environment variable from the local keyserver
#
# Can be used to initialize environment variables.
#
# export PASSWORD=$( vaultenv db/password )
#
# Author:: Michael Heijmans (mailto:parabuzzle@gmail.com)
# Copyright:: Copyright (c) 2016 Michael Heijmans
# License:: MIT
View vault_loader.rb
# A simple library for working with Vault
#
# Author:: Michael Heijmans (mailto:parabuzzle@gmail.com)
# Copyright:: Copyright (c) 2016 Michael Heijmans
# License:: MIT
require 'vault'
require 'yaml'
class VaultLoader
@parabuzzle
parabuzzle / Dockerfile
Created Apr 1, 2016
debian package build env
View Dockerfile
FROM ubuntu:12.04
MAINTAINER parabuzzle@gmail.com
VOLUME /compilations
ENV TERM linux
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update && apt-get dist-upgrade -qq -y
View .gitconfig
#
# default .gitconfig
#
[alias]
praise = blame
@parabuzzle
parabuzzle / letter_counter.rb
Last active Oct 20, 2015
Needed a simple way of telling me how many of each letter I needed to cut on the laser cutter
View letter_counter.rb
def letter_count(str)
str.chars.each_with_object({}) do |char, hash|
next if char == " " # skip spaces
hash.store(char, 0) if hash[char].nil?
hash[char] +=1
end
end
letter_count("hello world").each { |char,count| puts [char, count].join(" == ") }
@parabuzzle
parabuzzle / parse_yaml_for_bash.rb
Created Sep 15, 2015
I built this... I'm not proud... but yea, it works....
View parse_yaml_for_bash.rb
#!/usr/bin/env ruby
#
# Parses a given yaml file and returns prefix_key=value
# Usage: parse_yaml_for_bash <yaml_file> <prefix>
require 'yaml'
unless ARGV[0]
puts "Usage: parse_yaml_for_bash <yaml_file> <optional prefix>"
exit 1
View gist:db0f2338899331c3afa9
function duse {
_ENV=`docker-machine env $@`
if [ $? -ne 0 ]; then
printf "$_ENV"
return 1
elif [ -z "$1" ]; then
printf "$_ENV"
else
eval $_ENV