View dl2csv.R
library(rvest)
x <- "<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>"
y <- read_html(x)
View mkrproj.sh
#!/bin/bash
# Usage: mkproj [projectname]
# projectname defaults to name of current directory
template="Version: 1.0\nRestoreWorkspace: Default\nSaveWorkspace: Default\nAlwaysSaveHistory: Default\n\nEnableCodeIndexing: Yes\nUseSpacesForTab: Yes\nNumSpacesForTab: 4\nEncoding: UTF-8\n\nRnwWeave: knitr\nLaTeX: pdfLaTeX"
wd=$(basename `pwd`)
if [ -z $1 ]; then
View wdqs-cocktails.R
cocktails <- WikidataQueryServiceR::query_wikidata('
SELECT DISTINCT ?cocktailLabel ?ingredientLabel ?instanceOfLabel ?subclassLabel
WHERE
{
?cocktail wdt:P31/wdt:P279* wd:Q134768 .
?cocktail wdt:P186 ?ingredient .
OPTIONAL {
?ingredient wdt:P279 ?subclass .
}
OPTIONAL {
View app.R
header <- headerPanel("Hello Shiny!")
header[[2]]$attribs$id = "header"
ui <- fluidPage(
tags$head(
tags$link(rel = "stylesheet", type = "text/css", href = "custom.css")
),
header,
sidebarLayout(
sidebarPanel(sliderInput("obs", "Number of observations:", min = 0, max = 1000, value = 500)),
View test_2016-12-16_23:48:33.log.md

Test Run

Parameters

start_date end_date omit_times disable_forecasts help
2016-12-01 2016-12-02 FALSE FALSE FALSE

Reports

View keybase.md

Keybase proof

I hereby claim:

  • I am bearloga on github.
  • I am mikhailpopov (https://keybase.io/mikhailpopov) on keybase.
  • I have a public key ASCf0zmMPu2vZKS1L64MOIaEEZ2n4ZsLRhW64H1k0sO5TQo

To claim this, I am signing this object:

View upgrade_packages.R
# WMF only:
if (file.exists("/etc/wikimedia-cluster")) {
message('Detected that this script is being run on a WMF machine ("', Sys.info()["nodename"], '"). Setting proxies...')
Sys.setenv("http_proxy" = "http://webproxy.eqiad.wmnet:8080")
Sys.setenv("https_proxy" = "http://webproxy.eqiad.wmnet:8080")
}
# General use:
message("Checking for a personal library...")
if (!dir.exists(Sys.getenv("R_LIBS_USER"))) {
View clickable-imgs.js
<script language="JavaScript">
$(function() {
/* Lets the user click on the images to view them in full resolution. */
$("div.figure img").wrap(function() {
var link = $('<a/>');
link.attr('href', $(this).attr('src'));
link.attr('title', $(this).attr('alt'));
link.attr('target', '_blank');
return link;
});
View example.Rmd
title output
dyEvent Example
html_document
css
style.css
library(xts)
library(dygraphs)
View wikipedia_multilang_subtitles.R
suppressMessages({
# Preamble ========================================
# ======== Web Scraping ===========================
library(rvest) # install.packages('rvest')
library(magrittr)
# ======== I/O ====================================
library(httr) # install.packages('httr')
})
html <- read_html("https://wikipedia.org")