Skip to content

Instantly share code, notes, and snippets.

View andyl's full-sized avatar
🎯
Focusing

andyl

🎯
Focusing
View GitHub Profile
<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;
@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
@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

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

# 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 : }
asdf
asdf
asdf
asdf
asdfL
# The mail servers of many SMS gateways treat email as spam if the mails
# arrive too frequently. This has happened using the SMS-gateways managed
# by Verizon and Sprint.
#
# Maintains a queue of delivery addresses for a given carrier.
# Limits the sending frequency, to reduce the chance of being rejected as spam.
#
class CarrierQueue
#!/usr/bin/env ruby
require 'rubygems'
require 'spreadsheet'
book = Spreadsheet.open 'input.xls'
sheet = book.worksheet 0
sheet[0,0] = "Changed Cell"
book.write 'output.xls'
#!/usr/bin/env ruby
require 'rubygems'
require 'spreadsheet'
book = Spreadsheet.open 'input.xls'
sheet = book.worksheet 0
sheet[0,0] = "Changed Cell"
book.write 'output.xls'
#!/usr/bin/env ruby
require 'rubygems'
require 'faye'
abort "Usage: #{$0} <url> <channel> <nick>" if ARGV.length != 3
$url, $channel, $nick = ARGV
$client = Faye::Client.new($url)