Skip to content

Instantly share code, notes, and snippets.

@nlindley
Last active December 22, 2015 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nlindley/6544291 to your computer and use it in GitHub Desktop.
Save nlindley/6544291 to your computer and use it in GitHub Desktop.
Silly one-liner that lists directory contents (for my use-case, they were only regular files), strips the extension, titleizes the filename, and prepends that as a Markdown heading.
for FILENAME in `ls`; do perl -pi -e "print \"# `ruby -e \"require 'active_support/inflector'; puts '${FILENAME%.md}'.titleize\"`\n\n\" if $. == 1" $FILENAME; done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment