This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(emoGG) | |
source("imgcat.R") | |
p <- ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + geom_emoji(emoji="1f337") | |
imgcat(print(p)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dayLength = 24 * 60 * 60 * 1000 | |
beforeMidnight = (dayLength - 1) | |
endDate = (year, month, day) -> | |
date = new Date(year, parseInt(month or 1)-1, day or 1) | |
return new Date(date.getTime() + beforeMidnight) | |
exports.parseDate = (dateString) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION nomenklatura (key text, dataset text, api_key text) | |
RETURNS text | |
AS $$ | |
import json, urllib, urllib2 | |
url = 'http://nomenklatura.okfnlabs.org/%s/lookup?' % dataset | |
url += urllib.urlencode({'api_key': api_key, 'key': key}) | |
req = urllib2.Request(url, None, {'Accept': 'application/json'}) | |
try: |
NewerOlder