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
# Comment to a new pull request.
pullRequestOpened: >
Thank you for raising your pull request.
By making this pull request, you agree your contribution is made under the [Developer Certificate of Origin](https://developercertificate.org/).
# Use the official image as a parent image
FROM ubuntu:18.04
# Run the commands
RUN apt-get update
RUN apt-get install sudo
RUN adduser --disabled-password --gecos '' docker
RUN adduser docker sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER docker
RUN sudo apt-get update
from wordnik import *
apiUrl = 'http://api.wordnik.com/v4'
apiKey = 'YOUR KEY HERE'
client = swagger.ApiClient(apiKey, apiUrl)
wordApi = WordApi.WordApi(client)
res = wordApi.getWord('cat')
// you need to call getDefinitions on a word, as the part of speech lives at the definition level:
res2 = wordApi.getDefinitions('cat')
assert res, 'null getWord result'
### 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:
@emckean
emckean / gist:8244627
Created January 3, 2014 19:22
word view code
function addWordView() {
var checkSession = session.checkSessionCookie(req, res);
var encodedWord = encodeURI(req.params.word);
encodedWord = encodedWord.replace(/ /g, "%20");
userAgent = encodeURI(req.headers['user-agent']);
placeholderServerID = "1.2.3.4";
var url = config.apiServer+'word.json/'+encodedWord+'/wordView?userGuid=0&userAgent='+userAgent+'&serverIp='+placeholderServerID+'&api_key=' + config.apiKey;
var postObj = {};
postObj.userGuid = "0";
postObj.word = encodedWord;
@emckean
emckean / gist:7993001
Last active December 31, 2015 13:29
white elephant rules 2013
1. Each participant supplies one wrapped gift. Gifts should be useless/awkward/silly but non-broken. (That is, they are useless by design and not by circumstance.)
2. The gifts are placed in a central location.
3. Participants take a number from a hat to determine in what order they will take turns selecting them.
4. The first person opens a wrapped gift and the turn ends.
5. On subsequent turns, each person gets the choice of “stealing” any unwrapped item or choosing a wrapped one from the gift pile. A gift can only be stolen three times, and then it's "frozen" with the last successful thief.
6. When a player's gift is stolen, they must select a replacement gift from the pile of wrapped presents or steal one of the unwrapped gifts. The player cannot immediately re-steal the stolen gift.
7. The game is over when the last person has taken their turn.
@emckean
emckean / gist:6875356
Created October 7, 2013 21:34
wikipedia colors list as of Oct 7 2013
Acid
Air Force blue
Variations of cyan
Shades of violet
Crimson
Alice blue
Alizarin crimson (color)
Shades of orange
List of Crayola crayon colors
Amaranth (color)
@emckean
emckean / gist:6678197
Created September 23, 2013 23:01
top ten unchuggable liquids, from #xoxofest w/@biorhythmist and @joshleejosh
10. V8
9. tonic water
8. mayo/ketchup/mustard (3-way tie)
7. hot sauce [all]
6. soy sauce
5. bubble tea
4. cream sauces [all]
3. maple syrup
2. Karo syrup
1. clam chowder
exports.addWordView = function(req, res) {
var checkSession = session.checkSessionCookie(req, res);
var encodedWord = encodeURI(req.params.word);
encodedWord = encodedWord.replace(/ /g, "%20");
var url = config.apiServer+'word.json/'+encodedWord+'/wordView&?api_key=' + config.apiKey;
var postObj = {};
postObj.userGuid = "0";
postObj.word = encodedWord;
postObj.userAgent = req.headers['user-agent'];
console.log(postObj.userAgent);