Skip to content

Instantly share code, notes, and snippets.

View jploudre's full-sized avatar

Jonathan Ploudre jploudre

View GitHub Profile
@jploudre
jploudre / gist:11105143
Last active August 29, 2015 14:00
Find files and use pandoc
find . -name \*.md -type f -exec pandoc -o {}.txt {} \;
would run pandoc on all files with a .md suffix, creating a file with a .md.txt suffix.
(You will need a wrapper script if you want to get a .txt suffix without the .md,
or do ugly things with subshell invocations.) {} in any word from -exec to the
terminating \; will be replaced by the filename.
@jploudre
jploudre / gist:8065863
Created December 21, 2013 05:36
Autohotkey ternary
sub := (command1 = "#a") ? "add"
: (command1 = "#b") ? "build"
: (command1 = "#c") ? "change"
: (command1 = "#d") ? "down"
: (command1 = "#e") ? "unten"
: (command1 = "#f") ? "find"
: (command1 = "#i") ? "info"
: (command1 = "#j") ? "join"
: (command1 = "#k") ? "kill"
: (command1 = "#l") ? "locate"
@jploudre
jploudre / gist:7695046
Created November 28, 2013 17:04
Bash Script to rename files based on the first line
#!/bin/bash
for file in *
do
# Avoid renaming diretories!
if [ -f "$file" ]
then
newname=`head -1 $file`
if [ -f "$newname" ]
then