Skip to content

Instantly share code, notes, and snippets.

View emckean's full-sized avatar
💭
have I told you about Wordnik?

Erin McKean emckean

💭
have I told you about Wordnik?
View GitHub Profile
### Keybase proof
I hereby claim:
* I am emckean on github.
* I am emckean (https://keybase.io/emckean) on keybase.
* I have a public key whose fingerprint is 0D55 046A B584 EAF5 90BC 7396 D9B9 E6E5 E0F1 2BB7
To claim this, I am signing this object:
require 'wordnik'
%w(rubygems wordnik).each {|lib| require lib}
Wordnik.configure do |config|
config.api_key = ''
config.response_format = 'xml'
end
#unless ARGV.length == 2
/Users/emckean/.rvm/gems/ruby-1.9.2-p180/gems/wordnik-4.06.10/lib/wordnik/response.rb:21:in `initialize': message (ClientError)
from /Users/emckean/.rvm/gems/ruby-1.9.2-p180/gems/wordnik-4.06.10/lib/wordnik/request.rb:173:in `new'
from /Users/emckean/.rvm/gems/ruby-1.9.2-p180/gems/wordnik-4.06.10/lib/wordnik/request.rb:173:in `make'
from /Users/emckean/.rvm/gems/ruby-1.9.2-p180/gems/wordnik-4.06.10/lib/wordnik/request.rb:177:in `response'
from /Users/emckean/.rvm/gems/ruby-1.9.2-p180/gems/wordnik-4.06.10/lib/wordnik/resource_modules/word_list.rb:84:in `get_word_list_by_id'
from single-list-test.rb:17:in `<main>'
/Users/emckean/.rvm/gems/ruby-1.9.2-p180/gems/wordnik-4.06.10/lib/wordnik/response.rb:21:in `initialize': user does not have access to word list 1 (ClientError)
from /Users/emckean/.rvm/gems/ruby-1.9.2-p180/gems/wordnik-4.06.10/lib/wordnik/request.rb:173:in `new'
from /Users/emckean/.rvm/gems/ruby-1.9.2-p180/gems/wordnik-4.06.10/lib/wordnik/request.rb:173:in `make'
from /Users/emckean/.rvm/gems/ruby-1.9.2-p180/gems/wordnik-4.06.10/lib/wordnik/request.rb:177:in `response'
from /Users/emckean/.rvm/gems/ruby-1.9.2-p180/gems/wordnik-4.06.10/lib/wordnik/resource_modules/word_list.rb:138:in `get_word_list_words'
from puborprivlists.rb:25:in `block in <main>'
from puborprivlists.rb:18:in `collect'
from puborprivlists.rb:18:in `each'
from puborprivlists.rb:18:in `<main>'
bailor
bailout
bailout bond
bait and switch
bait record
balance protection
balance reporting
balance sheet
balance sheet reserves
balanced anova
@emckean
emckean / gist:1355916
Created November 10, 2011 19:37
canonical forms
401(k) 401(k) plan
403(b) 403(b) plan
American depositary receipt American Depositary Receipt
American Institute Of Certified Public Accountants American Institute of Certified Public Accountants
ARB arb
automated bond system Automated Bond System
BA Ba
Board Of Directors board of directors
Bollinger bands Bollinger Bands
book runner bookrunner
%w(rubygems wordnik).each {|lib| require lib}
Wordnik.configure do |config|
config.api_key = 'YOUR_KEY_HERE'
end
result = Wordnik.words.get_frequency('judgement')
print result
@emckean
emckean / gist:2919470
Created June 12, 2012 19:06
Discovery Lunch Contest Rules
-- come to the discovery lunch with something cool you found on "teh internets" or in Real Life
-- be prepared to explain how you found it (esp if you found it someplace embarrassing, like how Thomas finds all his great gluten-free recipes on the Esperanto Haiku Yodeling forums ... )
-- we'll all vote on the best/funniest/coolest/most useful discovery (each week's category is a secret until the beginning of lunch) and the winner will get a PRIZE, over and above bragging rights.
@emckean
emckean / gist:2925372
Created June 13, 2012 17:26
randomizr rememberr
1.9.3p125 :001 > wordniks = ["ramesh", "robert", "tony", "..."]
=> ["ramesh", "robert", "tony", "..."]
1.9.3p125 :002 > randomniks = wordniks.shuffle
=> ["ramesh", "tony", "robert", "..."]
1.9.3p125 :003 > half = randomniks.length/2
=> 2
1.9.3p125 :004 > teama = randomniks.slice(0, half)
=> ["ramesh", "tony"]
1.9.3p125 :005 > teamb = randomniks.slice(half, randomniks.length)
=> ["robert", "..."]
@emckean
emckean / gist:3131321
Created July 17, 2012 19:07
anna's file magic
path = "path"
Dir.chdir(path)
Dir.foreach(dir) do |file|
doc = Nokogiri::XML(File.open('#{file}'))