Skip to content

Instantly share code, notes, and snippets.


boB Rudis hrbrmstr

View GitHub Profile
hrbrmstr /
Created Dec 12, 2020 — forked from kevwan/
The simplest way to write Dockerfile!

1. choose a simple linux image

For example alpine, it's only about 5MB.

2. set timezone if necessary

RUN apk add --no-cache tzdata
ENV TZ America/New_York
hrbrmstr / phantomjs.R
Created Dec 29, 2014
Scraping gnarly sites with phantomjs & rvest
View phantomjs.R
# example of using phantomjs for scraping sites that use a twisty maze
# of javascript to render HTML tables or other tags
# grab phantomjs binaries from here:
# and stick it somehere PATH will find it
# this example scrapes the user table from:
hrbrmstr / do_rpt.r
Last active Oct 22, 2020
parallel, parameterized knitr reports
View do_rpt.r
rpts <- list(list(out="one.html", params=list(some_var="One")),
list(out="two.html", params=list(some_var="Two")),
list(out="three.html", params=list(some_var="Three")),
list(out="four.html", params=list(some_var="Four")))
do_rpt <- function(r) {
hrbrmstr / app.R
Created Jan 23, 2017 — forked from leonawicz/app.R
Use custom local image files as icons in a Shiny Dashboard value box
View app.R
# This Shiny web application demonstrates the use of custom image files
# in place of icons for value boxes in Shiny Dashboard by overriding two
# functions:
# 'icon' from the shiny package and 'valueBox' from the shinydashboard package.
# Each function adds minimal, specific additional handling of image files.
# Note: A custom css file must also be included so that value boxes can
# display the icons. For that reason, do not expect images in place of icons to
hrbrmstr / gg_tweet.R
Last active Oct 16, 2020
use the magick device to make ggplots conform to twitter card or in-stream image optimal sizes, with or without "retina" resolution
View gg_tweet.R
theme_tweet_rc <- function(grid = "XY", style = c("stream", "card"), retina=TRUE) {
style <- match.arg(tolower(style), c("stream", "card"))
View continents.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View xpath-cheatsheet.js
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// 0. XPath Examples.
// More:
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
View asia.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
hrbrmstr / find_emoji.r
Created Oct 24, 2017
find and extract emoji in R
View find_emoji.r
# save this to '_chat.txt` (it require a login)
emoji_src <- ""
emoji_fil <- basename(emoji_src)
if (!file.exists(emoji_fil)) download.file(emoji_src, emoji_fil)
hrbrmstr / robotstxt.csv
Created Aug 1, 2017
robots.txt user agent strings from June 2017 robots.txt Common Crawl
View robotstxt.csv
useragent n
* 494648
IRLbot 378368
bingbot 100948
MJ12bot 94377
msnbot 66142
AhrefsBot 51999
Yandex 50260
Slurp 49160
SemrushBot 45041
You can’t perform that action at this time.