Skip to content

Instantly share code, notes, and snippets.

library(tidycensus)
library(tidyverse)
sysfonts::font_add_google("Roboto")
var <- "DP03_0025"
commute19 <- get_acs(
geography = "place",
variables = var,
survey = "acs1",
@noamross
noamross / gh_file.R
Last active December 3, 2020 09:25
Function to download a file from github via API, including large files and private repos
# TODO (maybe)
# - Vectorize on URLs
# - Allow for downloading whole directory contents if path is a directory
# - Make a recursive = TRUE argument for this case
# - Error messages/input checking
#' Gets a file from a github repo, using the Data API blob endpoint
#'
#' This avoids the 1MB limit of the content API and uses [gh::gh] to deal with
#' authorization and such. See https://developer.github.com/v3/git/blobs/
@rossmounce
rossmounce / OA-Nobel-with-rorcid-and-roadoi.R
Last active July 14, 2017 09:24
How many freely accessible works do Nobel prize winners have?
install.packages('rorcid')
install.packages('roadoi')
library(roadoi)
library(rorcid)
#Example ORCID given is that of Carol Greider, American molecular biologist
an.ORCID.ID <- "0000-0002-5494-8126"
#This step gets all works publicly known to ORCID to be associated to this person
out <- works(orcid_id(your.ORCID.ID))
@artemklevtsov
artemklevtsov / .gitlab-ci.yml
Last active January 12, 2024 04:14
Testing R package with GitLab CI (with code coverage)
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
@pietsch
pietsch / gist:a74f810277a52f3a0fb9
Last active February 17, 2016 10:35
How to install GitLab CI on openSUSE 12.3 GNU/Linux

Installing GitHub CI 5.0 on openSUSE 12.3

Although this GNU/Linux distro is not supported, were are already running GitLab on an openSUSE server, so let's see if we can set up a GitLab CI (Continuous Integration) server on openSUSE, too. These notes are basically a translation of http://doc.gitlab.com/ci/install/installation.html to SuSE. See also other unofficial GitLab installation guides: https://github.com/gitlabhq/gitlab-public-wiki/wiki/Unofficial-Installation-Guides

1. Packages / Dependencies

Installing the prerequisites is already a hassle, but I was able to map most of the Debian package names to SuSE's naming scheme using distromatch. So here we go:

sudo ln -s /usr/bin/vi /usr/local/bin/editor  ## give your favourite text editor a standard name