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
exports.getUserId = function(name) {
userName = name;
requestURL = config.apiServer+'user.json/'+userName + '?api_key='+config.apiKey;
request(requestURL, function (error, response, body) {
if (!error && response.statusCode == 200) {
userResult = JSON.parse(response.body);
userID = userResult.id;
console.log(userResult.id);
console.log(userID);
@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}'))
@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: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.
%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:1375383
Created November 18, 2011 02:23 — forked from kumanan/gist:1375379
glossary_words_with_examples
200-day moving average
401(k) plan
529 plan
A
ADVANCE
ALPHA
ARBITRAGE
ASK
AWAY
Abandon
@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
@emckean
emckean / gist:1335322
Created November 2, 2011 23:43
clean wsj glossary list 11/2
-DI
"Made whole" doctrine
+DI
1031 exchange
1035 exchange
1040 EZ
1098 form
1099
1099-B
1099-B Form
bailor
bailout
bailout bond
bait and switch
bait record
balance protection
balance reporting
balance sheet
balance sheet reserves
balanced anova
/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>'