Skip to content

Instantly share code, notes, and snippets.

View bearloga's full-sized avatar
🎲
RAND()

Mikhail Popov bearloga

🎲
RAND()
View GitHub Profile
library(purrr)
library(dplyr)
library(XML)
read_plist <- safely(readKeyValueDB)
safe_compare <- safely(compareVersion)
apps <- list.dirs(c("/Applications", "/Applications/Utilities"), recursive=FALSE)
# if you have something further than this far down that's bad you're on your own
@hrbrmstr
hrbrmstr / ghelp.R
Last active August 29, 2015 14:23
github search in rstudio viewer pane - source it and try it with ghelp("vapply")
ghelp <- function(topic, in_cran=TRUE) {
require(htmltools) # for getting HTML to the viewer
require(rvest) # for scraping & munging HTML
# github search URL base
base_ext_url <- "https://github.com/search?utf8=%%E2%%9C%%93&q=%s+extension%%3AR"
ext_url <- sprintf(base_ext_url, topic)
# if searching with user:cran (the default) add that to the URL
@noamross
noamross / disease_tweeps.R
Last active August 29, 2015 14:23
I wanted to make a list of my disease ecology followers and followees on twitter, so...
library(twitteR)
library(rlist)
library(pipeR)
library(stringi)
# Authenticate with twitter
# consumer/access keys and secrets for the twitter API must be defined elsewhere
setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)
# Get all my followers and followees
javascript:(function(){var g="#gamergate";var f=function(t){return t.split(' ').map(function(w){return w.toLowerCase()==g?w:'butt'}).join(' ')};var es=document.getElementsByClassName("tweet-text");for(var i=0;i<es.length;i++){if(es[i].innerText.toLowerCase().indexOf(g)>0)es[i].innerText=f(es[i].innerText)}})()