Skip to content

Instantly share code, notes, and snippets.

View jeroen's full-sized avatar

Jeroen Ooms jeroen

View GitHub Profile
@jeroen
jeroen / build-v8-solaris.sh
Last active January 28, 2023 07:20
Building V8 on Solaris 10
#VERSION=v8.17.0
VERSION=v10.24.1
PATH=/opt/csw/bin:$PATH
export CC="gcc"
export CXX="g++"
curl -OL "https://nodejs.org/download/release/${VERSION}/node-${VERSION}.tar.gz"
gunzip node-${VERSION}.tar.gz
rm -Rf node-${VERSION}
gtar xf node-${VERSION}.tar
cd node-${VERSION}
@jeroen
jeroen / pubkeys.R
Created September 14, 2021 18:31
read pubkey from certs
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
@jeroen
jeroen / math.Rmd
Last active September 14, 2021 17:45
Test Rmd math server-side, borrowed from https://rpruim.github.io/s341/S19/from-class/MathinRmd.html
---
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}
@jeroen
jeroen / build2.log
Created August 12, 2021 09:17
build arrow with LTO after pr
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' ...
@jeroen
jeroen / build.log
Created August 10, 2021 16:56
arrow with lto on mingw-w64 with gcc 10.3.0
> install.packages("arrow", type = 'source')
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cloud.r-project.org/src/contrib/arrow_5.0.0.tar.gz'
Content length 463913 bytes (453 KB)
downloaded 453 KB
* installing *source* package 'arrow' ...
** package 'arrow' successfully unpacked and MD5 sums checked
** using staged installation
*** Writing Makevars.win
@jeroen
jeroen / test-katex.Rmd
Last active July 13, 2021 19:10 — forked from jmcastagnetto/test-katex.Rmd
Testing the rOpenSci {katex} package
---
title: "Testing rOpenSci katex"
author: "Jesus M. Castagnetto, Jeroen Ooms"
date: "2021-07-12"
output:
html_document:
mathjax: null
---
```{r setup, include=FALSE}
@jeroen
jeroen / csv2021.R
Last active February 12, 2021 13:27
Quick 2021 benchmark of CSV readers in R
# Note: CSV parses are NOT DIRECTLY COMPARABLE.
# - data.table does not parse dates, it just gives strings.
# - data.table is only fast when OpenMP is supported, i.e. not on MacOS.
# - vroom takes advantage of altrep, which defers some parsing.
# - arrow takes advantage of hardware extensions if available.
# - results will be different if you specify the types of the columns.
library(vroom)
library(arrow)
library(data.table)
library(readr)
@jeroen
jeroen / crashdump.txt
Last active January 7, 2021 01:08
Using R arrow 2.0.0 under rosetta
Process: R [4618]
Path: /Library/Frameworks/R.framework/Versions/4.0/Resources/bin/exec/R
Identifier: R
Version: 0
Code Type: X86-64 (Translated)
Parent Process: ??? [4615]
Responsible: iTerm2 [2491]
User ID: 501
Date/Time: 2021-01-07 01:41:16.699 +0100
@jeroen
jeroen / libgit2-solaris.sh
Last active December 12, 2020 19:20
Building libgit2 on Solaris 10
# Install dependencies
sudo pkgutil -i cmake libssh2_dev libssl_dev
# Download latest release
cd ~/Desktop
curl -OL https://github.com/libgit2/libgit2/releases/download/v1.1.0/libgit2-1.1.0.tar.gz
gtar xzf libgit2-1.1.0.tar.gz
cd libgit2-1.1.0
# Patch to use C99 instead of C90
@jeroen
jeroen / downloads.R
Last active January 23, 2021 10:35
Plot reverse dependencies and download statistics
library(cranlogs)
library(dplyr)
library(lubridate)
library(ggplot2)
library(hrbrthemes)
pkgs <- c("curl", "RCurl")
df <- cranlogs::cran_downloads(pkgs, from = '2015-01-01', to = '2020-10-31')
monthly <- df %>% group_by(package = package, date=floor_date(date, "month")) %>%
summarize(count=sum(count))