Skip to content

Instantly share code, notes, and snippets.

View andyl's full-sized avatar
🎯
Focusing

andyl

🎯
Focusing
View GitHub Profile
asdf
asdf
asdf
asdf
asdfL
# this Define just ensures that app and configuration
# directories have been created for the deploy user.
#
# production apps are always stored in "/home/<user>/a".
# nginx configuration for the app is stored in "/home/<user>/a/_conf"
# the configuration directory is referenced in nginx.conf
define ngusr($duser = $title) {
sysuser { $duser : }

Overview

I love Foreman, but need some additional capabilities:

  • upstart/init script with different options than foreman supports (dependencies)
  • monit config files
  • separate export templates per app-type
  • separate start and stop commands for some app-types

Inspiration for Enhanced Foreman

@andyl
andyl / 30lines1.rb
Created May 1, 2012 23:46 — forked from isa/gist:2571012
Convert in less than 30 lines
#!/usr/bin/env ruby
DATA = <<-EOF
A, B, C
A, C, E
E, F, D
D, A, J
E, D, J
EOF
@andyl
andyl / rm_auto_display_formatter.rb
Created July 29, 2012 21:55
Rspec Formatter for RubyMine
require 'rubygems'
require 'rspec/core/example'
require 'rspec/core/formatters/progress_formatter'
require 'colored'
class RSpec::Core::Example
attr_reader :example_block
end
# Custom formatter for Rspec - intended for use with RubyMine
<meta http-equiv="Content-Type" content="text/html; charset=<%= encoding %>">
<% if mail.subject %>
<title><%= h mail.subject %></title>
<% end %>
<style type="text/css">
.message_headers {
width: 100%;
padding: 10px 0 0 0;
margin: 0;
// Bootstrap Mid-Small - col-ms-* - the missing grid set for Bootstrap3.
//
// This is a hack to fill the gap between 480 and 760 pixels - a missing range
// in the bootstrap responsive grid structure. Use these classes to style pages
// on cellphones when they transition from portrait to landscape.
//
// NOTE: Here I use SASS instead of LESS for styling. To convert to LESS
// replace '$screen' with '@screen' and '$grid' with '@grid'.
//
// See https://github.com/twbs/bootstrap/issues/10203 for more info.
# This file contains data-uri encoded images for testing.
# The advantage of data-encoded images for testing include:
# - no need for standalone web server
# - faster (synchronous?) image loading
# The images were originally generated by http://placehold.it
# To save a test image: `curl -o http://placehold.it/200x200.gif`
# To data-encode a test image, visit http://websemantics.co.uk/online_tools/image_to_data_uri_convertor/result/
# TODO: find a command-line converter...
.col-ms-1,
.col-ms-2,
.col-ms-3,
.col-ms-4,
.col-ms-5,
.col-ms-6,
.col-ms-7,
.col-ms-8,
.col-ms-9,
.col-ms-10,
@andyl
andyl / gist:4660c0fa2ff42f269e0f
Last active August 29, 2015 14:00
Picky Example
#!/usr/bin/env ruby
require 'picky'
# create an index which is auto-saved into './index'
# note that :id is implied - every input object must supply an :id !
index = Picky::Index.new :people do
category :age
category :name
end