Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View alexec's full-sized avatar
😀

Alex Collins alexec

😀
View GitHub Profile
skinparam shadowing false
skinparam defaultFontName "Futura"
skinparam activityArrowColor Black
skinparam activityBackgroundColor White
skinparam activityBorderColor Black
skinparam actorBackgroundColor White
skinparam actorBorderColor Black
skinparam monochrome true
skinparam shadowing false
skinparam handwritten false
autonumber
@alexec
alexec / dedup.sh
Created January 31, 2016 18:06
De-duplicate a directory of files
#! /bin/bash
set -eu
DB=~/.dedup
DUPS=dups
if [ ! -e $DB ]; then
mkdir $DB
fi
#! /bin/bash
set -eu
find . -mindepth 1 -maxdepth 1 -name '*.jpg' -or -name '*.JPG' | while read F ; do
echo $F
D=$(stat -f '%Sm' -t '%Y/%m/%d' "$F")
if [ ! -e $D ]; then
mkdir -p $D
fi
mv -v "$F" $D/
#! /bin/bash
set -eu
find "/Volumes/My Passport/Backups.backupdb/Alex Collins’s MacBook/2013-06-04-230142/Macintosh HD/Users/Shared/Pictures" -maxdepth 11 -path '*/Pictures/*' -type f \( -name '*.jpg' -or -name '*.JPG' -or -name '*.mov' -or -name '*.mov' \) | while read F ; do
D=$(stat -f '%Sm' -t '%Y/%m/%d' "$F")
if [ ! -e $D ]; then
echo "creating $D"
mkdir -p $D
fi
T="$D/$(basename "$F")"
@alexec
alexec / commit-msg
Created November 22, 2014 13:09
.git/hooks/commit-msg
#! /bin/sh
set -eu
if [ $(cat $1|grep -c '^[A-Z]*-[0-9]* \|Merge\|release') -eq 0 ]; then
echo "non-merge/release commit messages must start with a ticket ID" > /dev/stderr
exit 1
fi
@alexec
alexec / changelog.sh
Last active August 29, 2015 14:09
Create a CHANGELOG.md from Git history on Github
#! /bin/sh
# Creates a markdown formatted change log based the git history
set -eu
read -p "Enter your username:" USER > /dev/stderr
read -s -p "Please enter $USER's password:" PASS > /dev/stderr
OWNER=$(git remote show origin|grep "Fetch URL"|sed 's/.*https:...*\/\(.*\)\/\(.*\).git/\1/')
REPO=$(git remote show origin|grep "Fetch URL"|sed 's/.*https:...*\/\(.*\)\/\(.*\).git/\2/')
@alexec
alexec / mvncolor.sh
Last active August 29, 2015 14:04 — forked from katta/mvncolor.sh
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`
apt-get install nginx git ruby maven bundler
git clone https://github.com/alexec/www.alexecollins.com.git
cd www.alexecollins.com
bundler install
middleman build
mv /usr/share/nginx/html /usr/share/nginx/html.1
cp -R build /usr/share/nginx/html
apt-get install docker.io
vi /etc/init.d/docker.io