- No authority
- Official reference is writing r extentions (joke extentions)
- If you thought writing regular r packages was tricky, hold on
This file contains 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
# syntax=docker/dockerfile:1.3-labs | |
FROM fedora:36 | |
COPY <<EOF test.cpp | |
#include <libplatform/libplatform.h> | |
#include <v8.h> | |
using namespace v8; | |
int main(){ | |
std::unique_ptr<Platform> platform = platform::NewDefaultPlatform(); |
This file contains 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
# https://twitter.com/henrikbengtsson/status/1583520708470067201 | |
library(shiny) | |
library(sortable) | |
library(pdftools) | |
library(magick) | |
# The file to manipulate | |
pdffile <- tempfile(fileext = '.pdf') | |
download.file('https://www.uscis.gov/sites/default/files/document/forms/i-9-paper-version.pdf', pdffile) |
This file contains 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
#!/bin/bash | |
IPADDR="" | |
if [ -f /usr/bin/ec2metadata ] | |
then | |
IPADDR=`timeout 1 ec2metadata --public-hostname` | |
fi | |
if [ "$IPADDR" = "" ] | |
then |
This file contains 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
<!DOCTYPE html><html><head><title>R: Display math in R documentation</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | |
<link href="/doc/html/prism.css" rel="stylesheet" /> | |
<link rel="stylesheet" href="/doc/html/katex/katex.css"> | |
<script type="text/javascript" src="/doc/html/katex-config.js"></script> | |
<script defer src="/doc/html/katex/katex.js" | |
onload="processMathHTML();"></script> | |
<link rel="stylesheet" type="text/css" href="/doc/html/R.css" /> | |
</head><body><div class="container"> |
This file contains 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
ctx <- V8::v8() | |
ctx$source('https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.js') | |
ctx$eval('function validate(s){var out = {result: "ok", warnings:[]}; try{console.warn=function(w){out.warnings.push(w);};katex.renderToString(s)} catch (e) {out.result = e.name; out.position = e.position; out.message = e.message}; return out;}') | |
# Parsing error | |
ctx$call('validate', "E(y) = \\boldmath{\\mu}") | |
# OK but with warnings: | |
ctx$call('validate', "s*ₓᵢ = sₓᵢ √(VIFₓᵢ⁻¹) √((n-1)/(n-p))") |
This file contains 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
FROM ubuntu:bionic | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN \ | |
apt-get update && \ | |
apt-get install -y curl software-properties-common && \ | |
curl https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc && \ | |
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" && \ | |
apt-get update && \ |
This file contains 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
input <- jsonlite::fromJSON('https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com') | |
certs = lapply(input, openssl::read_cert) | |
certs[[1]]$pubkey | |
certs[[2]]$pubkey |
This file contains 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
--- | |
title: "Rending math to HTML in R using katex" | |
output: | |
html_document: | |
katex: true | |
self_contained: false | |
vignette: > | |
%\VignetteIndexEntry{Rending math to HTML in R using katex} | |
%\VignetteEngine{knitr::rmarkdown} | |
%\VignetteEncoding{UTF-8} |
This file contains 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
Running `R CMD build`... | |
* checking for file 'C:\Users\jeroen\AppData\Local\Temp\2\RtmpERT2kg\remotesa2c787f773d\jeroen-arrow-b52f493/DESCRIPTION' ... OK | |
* preparing 'arrow': | |
* checking DESCRIPTION meta-information ... OK | |
* cleaning src | |
* checking vignette meta-information ... OK | |
* checking for LF line-endings in source and make files and shell scripts | |
* checking for empty or unneeded directories | |
* building 'arrow_5.0.0.tar.gz' | |
* installing *source* package 'arrow' ... |