Skip to content

Instantly share code, notes, and snippets.

repo=$(git rev-parse --show-toplevel);
repo="${repo/\/Volumes\/CODE\//}";
repo="${repo/\/var\/www\/html\/announcemedia\//}";
branch=`git rev-parse --abbrev-ref HEAD`;
if [ "$branch" == "HEAD" ]; then
branch="";
else
branch="(BRANCH: $branch)";
fi;
deploy="# $(basename "$repo") $branch";
#!/bin/bash
#
# ArchLinux StackScript to create a rails / node box
#
# <UDF name="sys_hostname" Label="Hostname" example="Ex: test.example.com" />
#
#
# The idea behind this bash script is to create a ArchLinux box
# provisioned and hosted exactly as we'd like.
#
@patmcnally
patmcnally / cloud_spawn.sh
Created August 27, 2011 15:23
Arc Linux Cloud Spawn
#!/bin/bash
echo "Please enter hostname:"
read HOSTNAME
echo "Please enter port for SSHd to listen on:"
read SSHPORT
# Upgrade software
@patmcnally
patmcnally / .irbrc
Created March 30, 2011 03:54
.irbrc file that incorporates wirble, hirb, rails 3, and awesome print
# load libraries
require 'rubygems' rescue nil
require 'wirble'
#require 'json'
alias q exit
class Object
def local_methods
(methods - Object.instance_methods).sort
(defn map-apply-sum-exclusive [f s]
"Maps each element in s to the sum of f applied that element and all other elements in s"
(map-indexed
(fn [i item]
(reduce (fn [sum x] (+ sum x))
0
(keep-indexed (fn [j other-item]
(when (not (= i j))
(f item other-item)))
s