Skip to content

Instantly share code, notes, and snippets.

@raine raine/longest-words.sh
Last active Sep 26, 2015

Embed
What would you like to do?
#!/usr/bin/env bash
cat $1 | R -rR --slurp \
'unlines' \
'to-lower' \
'match /\w+/g' \
'lodash.uniq' \
'sort-by length' \
'reverse' \
'take 10'
# $ time ./longest-words shakespeare-hamlet-25.txt
# transformation
# unproportioned
# inventorially
# determination
# schoolfellows
# circumscribed
# reconcilement
# circumstances
# recognizances
# imperfections
# ./longest-words shakespeare-hamlet-25.txt 0.66s user 0.06s system 101% cpu 0.706 total
cat $1 | R -rR --slurp \
'unlines' \
'to-lower' \
'match /\w+/g' \
'uniq-with identical' \
'sort-by length' \
'reverse' \
'take 10'
# ~ ❯❯❯ time ./longest-words shakespeare-hamlet-25.txt
# transformation
# unproportioned
# inventorially
# determination
# schoolfellows
# circumscribed
# reconcilement
# circumstances
# recognizances
# imperfections
# ./longest-words shakespeare-hamlet-25.txt 9.88s user 0.08s system 99% cpu 10.004 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.