Skip to content

Instantly share code, notes, and snippets.

@ismaelga
Created September 11, 2012 22:33
Show Gist options
  • Save ismaelga/3702645 to your computer and use it in GitHub Desktop.
Save ismaelga/3702645 to your computer and use it in GitHub Desktop.
Lorens - Alfred extension problem
#!/usr/bin/env ruby
require "lorem"
hash = {'c' => 'chars', 'w' => 'words', 'p' => 'paragraphs'}
args = ARGV[0].split
*args = hash[args[1]], args[0].to_i
print Lorem::Base.new(*args).output
# works in normal mode but not with silent mode
cd ~/Library/Application\ Support/Alfred/extensions/scripts/Lorens
ruby lorens.rb {query} | pbcopy
echo "Lipsum text is now ready in the clipboard"
exit # added to exit terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment