Skip to content

Instantly share code, notes, and snippets.

artemklevtsov / .gitlab-ci.yml
Last active Jul 26, 2021
Testing R package with GitLab CI (with code coverage)
View .gitlab-ci.yml
APT_PKGS: "libcurl4-openssl-dev libssh2-1-dev libssl-dev libxml2-dev zlib1g-dev git"
- apt-get update
- apt-get install -y --no-install-recommends ${APT_PKGS}
- apt-get install -y --no-install-recommends qpdf pandoc pandoc-citeproc
klmr / list_comprehension.r
Created Feb 12, 2016
Haskell-like list comprehension for R
View list_comprehension.r
# Dummy object, only required for name resolution.
set = structure(list(), class = 'set')
print.set = function (x, ...) invisible(x)
`[.set` = function (set, expr, filter) {
expr = substitute(expr)
filter = substitute(filter)
stopifnot(identical(expr[[1]], quote(`<-`)))
stopifnot(identical(expr[[2]][[1]], quote(`|`)))
szilard / sqlite_vs_datatable.txt
Last active May 2, 2016
SQLite vs R data.table
View sqlite_vs_datatable.txt
sqlite vs R's data.table
TLDR; sqlite (:memory:) 250 sec data.table 7 sec
data: 100 million rows, 1 million groups
generated by:
semenko / dmidecode
Last active Oct 26, 2021
Dell XPS 13 2015 model 9343 on Ubuntu 15.04, dmidecode, lsusb, lspci
View dmidecode
$ sudo dmidecode
# dmidecode 2.12
# SMBIOS entry point at 0x000f0000
SMBIOS 2.8 present.
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
wch / unlockEnvironment.r
Created Aug 7, 2012
Sample code for unlocking environments in R
View unlockEnvironment.r
inc <- '
/* This is taken from envir.c in the R 2.15.1 source
#define FRAME_LOCK_MASK (1<<14)
textarcana /
Last active Jan 19, 2022
Convert Git logs to JSON. The first script ( is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO:
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'