Skip to content

Instantly share code, notes, and snippets.

@raine
Last active September 26, 2015 19:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raine/2f2c1206390aab878023 to your computer and use it in GitHub Desktop.
Save raine/2f2c1206390aab878023 to your computer and use it in GitHub Desktop.
#!/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