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
library(curl) | |
library(yaml) | |
parse_raw_gitpack <- function(buf){ | |
con <- rawConnection(buf) | |
on.exit(close(con)) | |
txt <- readLines(con, warn = FALSE) | |
stopifnot(grepl('^[0-9a-f]{4}#', txt[1])) | |
stopifnot(grepl('service=', txt[1])) | |
if(length(txt) == 2 && txt[2] == '00000000'){ |
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/sh | |
set -e | |
set -x | |
cd ~ | |
export R_CRAN_WEB="https://cran.rstudio.com" | |
export CRAN_RSYNC='mirrors.nic.cz::CRAN' | |
# Some prereqs | |
pacman -S --needed --noconfirm wget git make perl curl texinfo texinfo-tex rsync unzip diffutils | |
if [ ! -d "aarch64-w64-mingw32.static.posix" ]; 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
#include <curl/curl.h> | |
#include <stdlib.h> | |
#include <string.h> | |
size_t do_nothing(void *contents, size_t sz, size_t nmemb, void *ctx){ | |
return sz * nmemb; | |
} | |
CURL *make_handle(char *url){ | |
CURL *handle = curl_easy_init(); |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Hello World! Site Title</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.0/FileSaver.min.js"></script> | |
<script> | |
import('https://webr.r-wasm.org/latest/webr.mjs').then(function(x){ | |
const webR = new x.WebR(); |
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 fedora:36 | |
# Simulate the clang location from CRAN | |
RUN ln -s /usr /usr/local/clang15 | |
RUN dnf install -y clang llvm lld | |
COPY script.sh . | |
RUN ./script.sh |
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
<!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/[email protected]/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))") |
NewerOlder