Skip to content

Instantly share code, notes, and snippets.


Matthew Adams stellimatt

View GitHub Profile
View custom_method.rb
def execute_jslint(working_directory:)
Dir.chdir(working_directory) do
puts "Running jslint on #{working_directory}..."
results = `find . -name "*.js" -print0 | xargs -0 jslint`
puts results
View extended_static_analysis.rb
module Build
module Commit
class ExtendedStaticAnalysis < StaticAnalysis
def initialize(store:)
# execute base class logic first
super(store: store)
# execute custom logic
execute_jslint(working_directory: store.get(attrib_name: "params")[:working_directory])
stellimatt / blog_refactor_gem.rake
Last active September 26, 2016 22:26
gems rakefile
View blog_refactor_gem.rake
@meta[:steps].each do |step|
task_sym = "#{@meta[:pipeline]}:#{step[:phase]}:#{step[:name]}".to_sym
define_task(step[:description], task_sym) do |t, args|
# derive worker class namespace::name
pipeline = @meta[:pipeline].capitalize
phase = step[:phase].capitalize
job = step[:name].split('_').collect(&:capitalize).join
class_ref = "#{pipeline}::#{phase}::#{job}"
stellimatt / blog_refactor_app.rake
Last active September 26, 2016 22:19
Application's Rakefile to relay information to the gem's Rakefile.
View blog_refactor_app.rake
require 'yaml'
require 'blog_refactor_gem'
# Read in the application's pipeline metadata
meta_path = File.join(File.expand_path(File.dirname(__FILE__)), 'pipeline-meta.yml')
@meta = YAML.load(
# Define where our pipeline will keep its parameter store,
# responsible for passing parameters from task to task during the execution of the pipeline.
@store_path = File.join(File.expand_path(File.dirname(__FILE__)), 'store.json')
stellimatt / cfn_parameters.txt
Created September 1, 2016 00:26
Sample CFN parameters
View cfn_parameters.txt
"DbPassword": {
"Type": "String",
"Description": "Password for the database",
"NoEcho": true
"DbUsername": {
"Type": "String",
"Description": "Username for the database"
"DbUrl": {
stellimatt /
Last active September 1, 2016 00:59
example userdata
apt-get update
apt-get install git -y
git clone git:// /opt/greeter
if [ ":" == ":$(dpkg -l | grep chefdk)" ]; then
pushd /tmp
wget --quiet
dpkg -i chefdk_0.16.28-1_amd64.deb
mkdir /tmp/cookbooks