Skip to content

Instantly share code, notes, and snippets.

@danchoi
Created May 24, 2012 01:50
Show Gist options
  • Save danchoi/2778992 to your computer and use it in GitHub Desktop.
Save danchoi/2778992 to your computer and use it in GitHub Desktop.
The Twelve-Factor App philosophy in one plain text file
# Downloads the Twelve-Factor App guide from http://www.12factor.net/ and
# converts it to plain text, convenient for printing
base=www.12factor.net
out=12factor.txt
rm $out
wget -r http://$base
grep 'href.*h2' $base/index.html |
sed "s/.*href='\([^']*\)'>.*/\1/" |
while read chapter; do
echo
echo
elinks -dump $base/$(echo $chapter)
done >> $out
rm -rf $base
echo "File created: $out"
@danchoi
Copy link
Author

danchoi commented May 24, 2012

$base/$(echo $chapter) is redundant -- I was editing a different approach into this one and forgot to refactor it.

Should be $base/$chapter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment