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
#!/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/},]/}]/' |
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(inline) | |
inc <- ' | |
/* This is taken from envir.c in the R 2.15.1 source | |
https://github.com/SurajGupta/r-source/blob/master/src/main/envir.c | |
*/ | |
#define FRAME_LOCK_MASK (1<<14) | |
#define FRAME_IS_LOCKED(e) (ENVFLAGS(e) & FRAME_LOCK_MASK) | |
#define UNLOCK_FRAME(e) SET_ENVFLAGS(e, ENVFLAGS(e) & (~ FRAME_LOCK_MASK)) | |
' |
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
$ sudo dmidecode | |
# dmidecode 2.12 | |
# SMBIOS entry point at 0x000f0000 | |
SMBIOS 2.8 present. | |
<SNIP> | |
Handle 0x0000, DMI type 0, 24 bytes | |
BIOS Information |
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
sqlite vs R's data.table | |
TLDR; sqlite (:memory:) 250 sec data.table 7 sec | |
data: 100 million rows, 1 million groups | |
generated by: https://github.com/szilard/benchm-databases/blob/master/0-gendata.txt | |
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
# 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(`|`))) |
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
variables: | |
CODECOV_TOKEN: "CODECOV_TOKEN_STRING" | |
_R_CHECK_CRAN_INCOMING_: "false" | |
_R_CHECK_FORCE_SUGGESTS_: "true" | |
APT_PKGS: "libcurl4-openssl-dev libssh2-1-dev libssl-dev libxml2-dev zlib1g-dev git" | |
before_script: | |
- apt-get update | |
- apt-get install -y --no-install-recommends ${APT_PKGS} | |
- apt-get install -y --no-install-recommends qpdf pandoc pandoc-citeproc |