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
import java.io.IOException; | |
import java.io.InputStream; | |
/** | |
* @author alex.collins | |
*/ | |
public class SearchAndReplaceInputStream extends InputStream { | |
private final InputStream is; |
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
# suitable for small files only | |
require 'csv' | |
f='a.csv' | |
headers=['x','y'] | |
csv=[] | |
if File.exists?(f) | |
CSV.foreach(f, {:headers => :first_row, :converters => [:numeric]}) do |row| |
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
require 'csv' | |
class History | |
def initialize(name, cols, size) | |
@f=name | |
@headers=cols | |
@size=size | |
read | |
write | |
end |
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 | |
set -ue | |
BEGIN=$(date +%s) | |
BACK="\b\b\b\b" | |
($* ; touch /tmp/$$.done) & | |
OLDDIFF=0 | |
while true; do |
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
var is=document.getElementsByTagName('input');for (var i=0;i<is.length;i++){var x=is[i];if (x.type=='password') {x.type='text'}} |
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/sh | |
set -eux | |
cd docker-java | |
git pull | |
mvn clean deploy | |
git push | |
rm -R ~/.m2/repository/com/alexecollins/docker-java | |
cd .. |
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
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 |
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
#!/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` |
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/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/') |
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/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 |
OlderNewer