Skip to content

Instantly share code, notes, and snippets.

@mhayes
mhayes / supervisord.sh
Created March 12, 2011 01:13 — forked from danmackinlay/supervisord.sh
init.d for supervisord for Amazon Linux AMI
#!/bin/sh
# Amazon Linux AMI startup script for a supervisor instance
#
# chkconfig: 2345 80 20
# description: Autostarts supervisord.
# Source function library.
. /etc/rc.d/init.d/functions
supervisorctl="/usr/bin/supervisorctl"
@mhayes
mhayes / deploy.rb
Created September 30, 2011 21:16
Capistrano for Rails 3.1
require 'capistrano/ext/multistage'
require "bundler/capistrano"
#use local key for authentication
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
set :application, 'awesome'
set :repository, "git@github.com:zurb/awesome.git"
@mhayes
mhayes / .tmux.conf
Created October 12, 2018 19:24
tmux configuration
unbind C-b
set -g prefix C-s
unbind +
bind + new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \; swap-pane -s tmux-zoom.0 \; select-window -t tmux-zoom
unbind -
bind - last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoom
bind r source-file ~/.tmux.conf \; display "configuration file reloaded."
#set window numbering at 1
set -g base-index 1
@mhayes
mhayes / dsn-listing.cfm
Created January 3, 2011 15:47
List DSN's that exist on a particular server
<h2>Server: <cfoutput>#CGI.SERVER_NAME#</cfoutput></h2>
<p>
The following ColdFusion DSN's are available on this server:
</p>
<cfscript>
// Instantiate CF Admin API
adminObj = createObject("component","cfide.adminapi.administrator");
@mhayes
mhayes / slack-sns.js
Created April 11, 2017 19:16
SNS to Slack via Lambda
const https = require("https");
const util = require("util");
const SLACK_WEBHOOK_PATH = process.env.SLACK_WEBHOOK_PATH;
const SLACK_CHANNEL = process.env.SLACK_CHANNEL;
const SLACK_USERNAME = process.env.SLACK_USERNAME || "aws";
const SLACK_EMOJI = process.env.SLACK_EMOJI || ":aws:";
function noop (ret) {
if (ret) {
@mhayes
mhayes / index.php
Created April 8, 2015 01:07
Send an e-mail with PHP
<?php
if(isset($_POST['email'])) {
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$subject = trim($_POST['subject']);
$message = trim($_POST['message']);
if (preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", $email)) {
$to = "me@example.com";
$email_subject = "Contact Form Submission | $name";
@mhayes
mhayes / .bash_profile
Created December 4, 2012 18:51
Mountain Lion + rbenv + mysql2
export PATH="$HOME/.rbenv/bin:$PATH:/usr/local/mysql/bin"
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib
eval "$(rbenv init -)"
@mhayes
mhayes / SassMeister-input-HTML.html
Created January 8, 2014 01:06
Generated by SassMeister.com.
<div class="pie-timer deg-0"></div>
@mhayes
mhayes / SassMeister-input-HTML.html
Created January 7, 2014 23:55
Generated by SassMeister.com.
<div class="chart under-half"></div>
@mhayes
mhayes / SassMeister-input-HTML.html
Created January 7, 2014 22:46
Generated by SassMeister.com.
<div class="pie-timer deg-350">
<div class="before"></div>
<div class="after"></div>
</div>