This file contains hidden or 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) | |
| install.packages('hexbin') | |
| cars <- mtcars | |
| cars$car <- rownames(mtcars) | |
| cars <- cars[with(cars, order(hp)), ] | |
| cars$car <- factor(cars$car, levels = cars$car) | |
| cars$cyl[cars$cyl == 4] <- '4 cylinders' | |
| cars$cyl[cars$cyl == 6] <- '6 cylinders' | |
| cars$cyl[cars$cyl == 8] <- '8 cylinders' |
This file contains hidden or 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
| const config = require('config') | |
| const rp = require('request-promise-native') | |
| const Busboy = require('busboy') | |
| const temp = require('temp').track() | |
| const fs = require('fs') | |
| const path = require('path') | |
| const promiseRetry = require('promise-retry') | |
| let inkConfig = config.get('pubsweet-component-ink-backend') | |
| let inkEndpoint = inkConfig.inkEndpoint |
This file contains hidden or 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
| npm init -y | |
| npm install mkdirp blahah/hyperdrive dat-storage folder-walker through2 hyperdiscovery pumpify untildify |
This file contains hidden or 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
| // we have a geoJSON file (in this case for Guinea) on the web: | |
| var guinea = 'https://raw.githubusercontent.com/johan/world.geo.json/master/countries/GIN.geo.json' | |
| // and we have a function that does something with the geoJSON file: | |
| var handleGeoJSON = function (data) { | |
| // data is the JSON parsed into a JS object | |
| console.log(data) | |
| } | |
| // using jquery (you must have loaded jQuery first) - http://api.jquery.com/jquery.getjson |
This file contains hidden or 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
| hephaestus:hypercore rik$ npm run bench | |
| > [email protected] bench /Users/rik/c/mafintosh/hypercore | |
| > cd bench && ./all.sh | |
| > git checkout a54dcf9 | |
| # clearing cache | |
| > rm -rf cores |
This file contains hidden or 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
| cat ../crossref_processed.json | while read entry | |
| do | |
| doi=$(echo $entry | jq -r '.doi') | |
| echo creating "$doi" | |
| mkdir -p "$doi" | |
| echo $entry > "$doi/data.json" | |
| done |
This file contains hidden or 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
| # you'll need: | |
| # - bionode-ncbi (https://github.com/bionode/bionode-ncbi) | |
| # - jq (https://github.com/stedolan/jq) | |
| # count the number of retracted papers | |
| bionode-ncbi search pubmed "\"Retracted Publication\"" \ | |
| | jq -c 'select(.pubtype[] | inside("Retracted Publication"))' | |
| | wc -l | |
| # get DOIs for all the retracted papers |
This file contains hidden or 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
| for path in $(find ../articles_split/articles/ -type d -wholename '*\/*\/*\/*\/*' | grep '.\{36\}'); do | |
| mergeddir=$(echo $path | sed 's/\([0-9]\)\/\([0-9]\)\/\([0-9]\)\/\([0-9]\)\/\([0-9]\)/\1\2\3\4\5/') | |
| mkdir -p $mergeddir | |
| cp -R $path/* $mergeddir/ | |
| done |
This file contains hidden or 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
| const resultbatcher = ds => { | |
| let count = 0 | |
| const write = (list, cb) => { | |
| count += list.length | |
| bus.emit('results:receive', { | |
| hits: list.map(r => { | |
| r.source = ds.key | |
| return r |
This file contains hidden or 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
| const html = require('choo/html') | |
| const css = require('csjs-inject') | |
| const C = require('../lib/constants') | |
| const style = css` | |
| .search { | |
| height: 30px; | |
| width: 80%; | |
| bottom: 0; |