Skip to content

Instantly share code, notes, and snippets.

@gaborcsardi
gaborcsardi / install-igraph.R
Last active December 2, 2018 01:28
How to install the igraph R package
# Download the package from CRAN and install it automatically
install.packages("igraph")
# Load the package
library(igraph)
@gaborcsardi
gaborcsardi / install-igraph.sh
Created October 17, 2013 14:50
Standard igraph installation on a Unix(-like) system
./configure
make
make check
make install
root@rhub:~# dokku --trace rabbitmq:expose rhub 5672 4369 35197 15672
+ [[ -f /home/dokku/dokkurc ]]
+ [[ -d /home/dokku/.dokkurc ]]
+ for f in '$DOKKU_ROOT/.dokkurc/*'
+ source /home/dokku/.dokkurc/DOKKU_EVENTS
++ export DOKKU_EVENTS=1
++ DOKKU_EVENTS=1
+ [[ -n 1 ]]
+ set -x
+ parse_args rabbitmq:expose rhub 5672 4369 35197 15672
@gaborcsardi
gaborcsardi / cran-over-time.R
Last active July 18, 2020 19:21
Size of the CRAN R package repository over time
library(jsonlite)
## Download
pkgs <- fromJSON("http://crandb.r-pkg.org/-/events")
## Filter
na_pkgs <- unique(pkgs$name[ is.na(pkgs$date) ])
events <- pkgs[ ! pkgs$name %in% na_pkgs, c("date", "name", "event")]

Keybase proof

I hereby claim:

  • I am gaborcsardi on github.
  • I am gaborcsardi (https://keybase.io/gaborcsardi) on keybase.
  • I have a public key ASCYCFJfhgSPp_YvDb9HbKVnQDbYamq71iQMSSnn8Rw_wgo

To claim this, I am signing this object:

@gaborcsardi
gaborcsardi / benchmark.R
Created March 13, 2018 19:24
S4 vs R6, very crude
library(R6)
library(methods)
library(microbenchmark)
make_class4 <- function() {
cl <- setClass("num_with_id", slots = c(id = "character"),
contains = "numeric")
setGeneric("getId", function(x) stop("Not implemented"))
setMethod("getId", c("num_with_id"), function(x) x@id)
---
title: Examples for the async package
output:
html_document:
keep_md: yes
---
There is not too much text here, sorry. Please just read the code. :)
```{r}
@gaborcsardi
gaborcsardi / cleanupJenkinsWorkspaces.groovy
Created September 30, 2018 20:22 — forked from EvilBeaver/cleanupJenkinsWorkspaces.groovy
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
---
title: "Overview of Tools for External (R) Processes"
output:
html_document:
df_print: paged
---
## processx - run external processes
```{r}
@gaborcsardi
gaborcsardi / notes.Rmd
Last active July 16, 2019 00:15
TGM 2019-07-15
---
title: "Some new features in processx and callr"
output: html_notebook
---
# Better errors in processx, callr, gh
## Better errors from C
```{r error = TRUE}