Skip to content

Instantly share code, notes, and snippets.

View rossmounce's full-sized avatar
🏠
Working from home

Ross Mounce rossmounce

🏠
Working from home
View GitHub Profile
@drjwbaker
drjwbaker / Mining Digital Repositories.md
Last active August 29, 2015 13:58
Mining Digital Repositories: Challenges and Horizons, KB, Den Haag, 10 April 2014

###Mining Digital Repositories: Challenges and Horizons, KB, Den Haag, 10 April 2014

Live notes, so an incomplete, partial record of what actually happened.

Tag #digrep14


####Challenges (Thursday)

Hans Jansen, KB

@sckott
sckott / plos_solr_search.md
Created April 22, 2014 16:23
PLOS API solr search using solr R pkg

Install from CRAN and load

install.packages("solr")
library("solr")

Define URL

@sckott
sckott / beswordles.r
Created December 21, 2012 18:13
Wordles for #BES12 tweets
#
install.packages(c("twitteR","wordcloud","tm"))
library(twitteR); library(wordcloud); library(tm)
# Search for #bes12 tweets
bestweets <- searchTwitter("#bes12", n=5000)
length(bestweets) # ends up with 1344 as of 21-Dec-12 at 17:00 London time
# make into a data.frame
bestweets_df <- twListToDF(bestweets)
library("RCurl")
library("XML")
library("plyr")
library("ggplot2")
library("directlabels")
########################
# Download PubMed Data #
########################
@hubgit
hubgit / publishers-dois.csv
Created July 12, 2013 14:13
Approximate number of "journal article" DOIs registered by each publisher for articles published in 2012. Total: 2,189,820. ISSNs + publishers from http://www.crossref.org/titleList/ DOI counts per ISSN from http://search.labs.crossref.org/dois?year=2012&type=Journal+Article&header=true&rows=0&q={ISSN}
Elsevier 529633
Springer-Verlag 206527
Wiley Blackwell (John Wiley & Sons) 110387
Wiley Blackwell (Blackwell Publishing) 100235
Informa UK (Taylor & Francis) 85869
Trans Tech Publications 53310
Sage Publications 42105
Oxford University Press 40496
American Chemical Society 39543
Ovid Technologies (Wolters Kluwer) - Lippincott Williams & Wilkins 39186
# dhist.
# An another algorithm for computing histogram breaks. Produces irregular bins.
# Provided by Lorraine Denby
#
#
# @keyword internal
dhist <- function(x, a=5*diff(quantile(x, c(0.25,0.75))), nbins=10, rx = range(x)) {
x <- sort(x)
if(a == 0)
a <- diff(range(x))/100000000
@danog
danog / dropbox_youtube_dl.sh
Last active January 13, 2018 16:00 — forked from roblight/dropbox_youtube_dl.sh
Script to download videos from YouTube using Dropbox and IFTTT automation (IFTTT recipe: https://ifttt.com/recipes/277403-download-every-youtube-video-you-add-to-your-watch-later-playlist-automatically)
#!/bin/bash
### Original script by Geoffeg, modified by Roblight and later by me (alias me='alias Danog='Daniil Gentili'')
### How to install this script:
### wget https://gist.github.com/danog/a3963463892f7f7df74a/raw/dropbox_youtube_dl.sh -O ~/dropbox_youtube_dl.sh && chmod 755 ~/dropbox_youtube_dl.sh && ~/dropbox_youtube_dl.sh --install
###
### IFTTT Recipe URL: https://ifttt.com/recipes/277403-download-every-youtube-video-you-add-to-your-watch-later-playlist-automatically
if [ "$1" = "--install" ]; then
if [ -f /usr/local/bin/youtube-dl ]; then echo "Youtube-dl already installed."; else echo "Installing youtube-dl..."; sudo curl https://yt-dl.org/downloads/2015.04.03/youtube-dl -o /usr/local/bin/youtube-dl && sudo chmod a+x /usr/local/bin/youtube-dl && echo "YouTube-dl installed successfully." || echo "Couldn't install YouTube-dl."; fi
@dsparks
dsparks / geocoded_Tweets.R
Created December 18, 2012 17:15
Gathering Tweets, geocoding users, and plotting them
doInstall <- TRUE
toInstall <- c("twitteR", "dismo", "maps", "ggplot2")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
searchTerm <- "#rstats"
searchResults <- searchTwitter(searchTerm, n = 1000) # Gather Tweets
tweetFrame <- twListToDF(searchResults) # Convert to a nice dF
userInfo <- lookupUsers(tweetFrame$screenName) # Batch lookup of user info
@yihui
yihui / brush-loader.html
Created February 11, 2012 22:53
SyntaxHighlighter Brush for the R Language
<script type="text/javascript">
SyntaxHighlighter.autoloader(
"r  path/to/your/syntaxhighlighter/scripts/shBrushR.js",
"plain  path/to/your/syntaxhighlighter/scripts/shBrushPlain.js",
"sql  path/to/your/syntaxhighlighter/scripts/shBrushSql.js",
"js  path/to/your/syntaxhighlighter/scripts/shBrushJScript.js",
"html xml  path/to/your/syntaxhighlighter/scripts/shBrushXml.js"
);
SyntaxHighlighter.defaults["toolbar"] = false;
SyntaxHighlighter.all();