Helpful Migration Guides:
eur<-read_csv('GEOSTAT_grid_POP_1K_2011_V2_0_1.csv') | |
#two ways to extract east and north | |
eur$North <-str_match(eur$GRD_ID, "1kmN(\\d\\d\\d\\d)E(\\d\\d\\d\\d)")[,2] | |
eur$East <-str_match(eur$GRD_ID, "1kmN(\\d\\d\\d\\d)E(\\d\\d\\d\\d)")[,3] | |
eur<-eur%>% | |
mutate( | |
lat = as.numeric(gsub('.*N([0-9]+)[EW].*', '\\1', GRD_ID))/100, | |
lng = as.numeric(gsub('.*[EW]([0-9]+)', '\\1', GRD_ID)) * ifelse(gsub('.*([EW]).*', '\\1', GRD_ID) == 'W', -1, 1) / 100 | |
) |
{ | |
"presets": [ | |
[ | |
"@babel/preset-env", | |
{ | |
"targets": { | |
"node": "current" | |
} | |
} | |
], |
# Comparison of JavaScript WYSIWYG editors | |
*Comparison as of September 6, 2016.* | |
While building [iDoRecall](http://idorecall.com), we looked for a WYSIWYG editor to enable our users to create and paste rich text recalls. While Markdown is great, it can't carry on much of the formatting that our audience is likely to encounter in the wild, so we looked for a WYSIWYG editor with the following features: | |
* correct pasting of minimally rich text from a variety of online sources (Google Docs, StackOverflow) | |
* paste images from clipboard directly, the way Slack, Imgur, GitHub, Google Docs and StackOverflow work | |
* usable on modern browsers and mobile devices; IE < 9 support not important | |
* relatively lightweight |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
def get_count(q): | |
count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
count = q.session.execute(count_q).scalar() | |
return count | |
q = session.query(TestModel).filter(...).order_by(...) | |
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
print q.count() |
# Add the following 'help' target to your Makefile | |
# And add help text after each target name starting with '\#\#' | |
help: ## Show this help. | |
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
# Everything below is an example | |
target00: ## This message will show up when typing 'make help' | |
@echo does nothing |
In order to configure the bitbucket hook we need two things: The user's API Token and the project token. In order to retrieve the first one whe should click on our username (on the top right corner of the page), click on configure and then click on "Show API Token". This API token will be used as password for our user.
For the project's token we need to go to the job configuration (/job/{job-name}/configure), "build triggers" and enable "trigger remote builds" and, there, input some random text as token.
Once we have these two tokens we can go to bitbucket, repo administration, hooks section, and add a new jenkins hook that we will configure like:
- Endpoint: http://{username}:{APIToken}@{hostname}/{prefix_if_you_have_one}
- Module name: Whatever (I usually leave this one blank)
- Project name: The job name
- Token: The project token