Instantly share code, notes, and snippets.

View ex.json
{
"stuff": {
"buried": {
"deep": [
{
"goodstuff": "here",
"name": "Bob Rudis",
"secret_power": 5
},
{
View eml-software.xml
<?xml version="1.0" encoding="UTF-8"?>
<eml:eml xmlns:eml="eml://ecoinformatics.org/eml-2.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
packageId="eml-1.2" system="knb"
xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1/ eml.xsd">
<software>
<alternateIdentifier>eml2</alternateIdentifier>
<title>eml2: Create and Manipulate Data using the Ecological Metadata Language</title>
<creator id="http://orcid.org/0000-0002-1642-628X">
<individualName>
View redlist_api.R
## From DS421, iterating over multiple parameters in an API call
## pmap not necessary since we could create a single vector of urls to iterate over via mutate
library(tidyverse)
extinct = read_csv("https://espm-157.github.io/extinction-module/extinct.csv")
out <-
extinct[1:5,] %>% # use a subset for testing
pmap_df( function(Genus, Species, ...){ # ... to swallow extra rows
url <- paste0("http://api.iucnredlist.org/index/species/",
Genus, "-", Species, ".json")
View tipping-bass.Rmd
```{r}
library(ggplot2)
```
Here's the J model:
```{r}
p1 <- 1
View jqr.R
library(jqr)
eml <-
'
{
"id": "https://doi.org/10.data",
"type": "Dataset",
"coverage": {
"temporalCoverage": {
"beginDate": "2012-06-01",
View giithub_clone_pull.R
library(gh)
library(git2r)
library(purrr)
library(dplyr)
## CHECK YOU ARE IN THE DESIRED WORKING DIRECTORY!
Sys.setenv(GITHUB_PAT="XXX")
## Clone all of the user's private repos under account "cboettig"
View keybase.md

Keybase proof

I hereby claim:

  • I am cboettig on github.
  • I am cboettig (https://keybase.io/cboettig) on keybase.
  • I have a public key ASAz0gxbUzsHhf-cDSJjzISTtSHg7sKqQnmgegw0x6Sv0wo

To claim this, I am signing this object:

View circle-github-deploy.sh
#!/bin/bash
set -e
if [ -e ".git/shallow"] then
git config user.name 'Circle CI' && \
git config user.email 'bot@circleci.com'
git fetch --unshallow
git add docs/ && \
git commit -m 'site built on circle ci [ci skip]'
View parallel_do.R
do_parallel <- function(df, f, ...){
# supports only one group for now
require("parallel")
require("lazyeval")
require("reshape2")
options(mc.cores = detectCores())
grps <- groups(df)
View Dockerfile
FROM rocker/hadleyverse
## So that things like `top` and `less` work correctly
ENV TERM xterm
## Install basic ruby, javascript, and linux utils we need for the site ##
RUN apt-get update \
&& apt-get install -y -t unstable \
bundler \
nodejs \
&& installGithub.r yihui/servr \
&& apt-get clean \