This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Please enter hostname:" | |
read HOSTNAME | |
echo "Please enter port for SSHd to listen on:" | |
read SSHPORT | |
# Upgrade software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load libraries | |
require 'rubygems' rescue nil | |
require 'wirble' | |
#require 'json' | |
alias q exit | |
class Object | |
def local_methods | |
(methods - Object.instance_methods).sort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |