Skip to content

Instantly share code, notes, and snippets.

Mark Hayes mhayes

Block or report user

Report or block mhayes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mhayes /
Created Mar 12, 2011 — forked from danmackinlay/
init.d for supervisord for Amazon Linux AMI
# 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
mhayes / deploy.rb
Created Sep 30, 2011
Capistrano for Rails 3.1
View deploy.rb
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, ""
mhayes / .tmux.conf
Created Oct 12, 2018
tmux configuration
View .tmux.conf
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 / dsn-listing.cfm
Created Jan 3, 2011
List DSN's that exist on a particular server
View dsn-listing.cfm
<h2>Server: <cfoutput>#CGI.SERVER_NAME#</cfoutput></h2>
The following ColdFusion DSN's are available on this server:
// Instantiate CF Admin API
adminObj = createObject("component","cfide.adminapi.administrator");
mhayes / slack-sns.js
Created Apr 11, 2017
SNS to Slack via Lambda
View slack-sns.js
const https = require("https");
const util = require("util");
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 / index.php
Created Apr 8, 2015
Send an e-mail with PHP
View index.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 = "";
$email_subject = "Contact Form Submission | $name";
mhayes / .bash_profile
Created Dec 4, 2012
Mountain Lion + rbenv + mysql2
View .bash_profile
export PATH="$HOME/.rbenv/bin:$PATH:/usr/local/mysql/bin"
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib
eval "$(rbenv init -)"
mhayes / SassMeister-input-HTML.html
Created Jan 8, 2014
Generated by
View SassMeister-input-HTML.html
<div class="pie-timer deg-0"></div>
mhayes / SassMeister-input-HTML.html
Created Jan 7, 2014
Generated by
View SassMeister-input-HTML.html
<div class="chart under-half"></div>
mhayes / SassMeister-input-HTML.html
Created Jan 7, 2014
Generated by
View SassMeister-input-HTML.html
<div class="pie-timer deg-350">
<div class="before"></div>
<div class="after"></div>
You can’t perform that action at this time.