Skip to content

Instantly share code, notes, and snippets.

library(patchwork)
library(ggplot2)
library(purrr)
library(dplyr)
library(glue)
map(
5:8,
~iris %>%
filter(Petal.Length < .x) %>%
ggplot() +
@maelle
maelle / labels.R
Created April 16, 2018 08:55
Create labels for the unconf18 repo issue tracker
# not possible to change labels via V4
# https://platform.github.community/t/mutations-for-label/2144
# list labels
current_labels <- gh::gh("/repos/:owner/:repo/labels",
owner = "ropensci",
repo = "unconf18")
current_labels <- purrr::map_chr(current_labels, "name")
# delete all labels
@mhucka
mhucka / Makefile (updated 2018-02-09)
Last active March 29, 2022 20:34
Makefile for generating a preview of a JOSS journal paper
# =============================================================================
# @file Makefile
# @brief Makefile for generating previews of the paper
# @author Michael Hucka <[email protected]>
# @license Please see the file named LICENSE in the project directory
# @website https://github.com/casics/dassie
# =============================================================================
# Change the following values to match your configuration.
# .............................................................................

What is this?

A scratchpad for a classifer of software libraries focussing on a number of areas that will guide users to make more informed decisions about whether to include a library within their own project.

See librariesio/libraries.io#1486 for more information.

Themes/Questions

There are a number of key themes here that we need to look at. Within each I have posed a number of questions that might be of interest to a developer or maintainer.

Code

  • What scale is this project? - Looking at things like novel LoC, #dependencies and LoC in dependencies perhaps.
@ramnathv
ramnathv / concaveman.R
Created May 2, 2017 03:58
Using Concaveman in R using V8
# Using concaveman in R using V8
concaveman <- function(d){
library(V8)
ctx <- v8()
ctx$source('https://www.mapbox.com/bites/00222/concaveman-bundle.js')
jscode <- sprintf(
"var points = %s;var polygon = concaveman(points);",
jsonlite::toJSON(d, dataframe = 'values')
)
ctx$eval(jscode)
@cpsievert
cpsievert / europe.R
Last active December 1, 2017 23:05 — forked from halhen/europe.R
library(tidyverse)
library(plotly)
# I'm being lazy, please don't do this
# setwd("~/Downloads/Version 2_0_1/")
d <- read_csv('GEOSTAT_grid_POP_1K_2011_V2_0_1.csv') %>%
rbind(read_csv('JRC-GHSL_AIT-grid-POP_1K_2011.csv') %>%
mutate(TOT_P_CON_DT = '')) %>%
mutate(
# data from http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat
# Originally seen at http://spatial.ly/2014/08/population-lines/
# So, this blew up on both Reddit and Twitter. Two bugs fixed (southern Spain was a mess,
# and some countries where missing -- measure twice, submit once, damnit), and two silly superflous lines removed after
# @hadleywickham pointed that out. Also, switched from geom_segment to geom_line.
# The result of the code below can be seen at http://imgur.com/ob8c8ph
library(tidyverse)
@seankross
seankross / wifi.sh
Last active April 6, 2017 15:58
power cycle wifi
alias wifi='networksetup -setairportpower en0 off;sleep 2;networksetup -setairportpower en0 on'
@Jamesits
Jamesits / caddy.sh
Last active January 27, 2024 14:47
Install Caddy Server on Ubuntu with Systemd.
# Should work on all Debian based distros with systemd; tested on Ubuntu 16.04+.
# This will by default install all plugins; you can customize this behavior on line 6. Selecting too many plugins can cause issues when downloading.
# Run as root (or sudo before every line) please. Note this is not designed to be run automatically; I recommend executing this line by line.
apt install curl
curl https://getcaddy.com | bash -s personal dns,docker,dyndns,hook.service,http.authz,http.awses,http.awslambda,http.cache,http.cgi,http.cors,http.datadog,http.expires,http.filemanager,http.filter,http.forwardproxy,http.geoip,http.git,http.gopkg,http.grpc,http.hugo,http.ipfilter,http.jekyll,http.jwt,http.locale,http.login,http.mailout,http.minify,http.nobots,http.prometheus,http.proxyprotocol,http.ratelimit,http.realip,http.reauth,http.restic,http.upload,http.webdav,net,tls.dns.auroradns,tls.dns.azure,tls.dns.cloudflare,tls.dns.cloudxns,tls.dns.digitalocean,tls.dns.dnsimple,tls.dns.dnsmadeeasy,tls.dns.dnspod,tls.dns.dyn,tls.
@dgrtwo
dgrtwo / separate_steps.R
Last active September 29, 2016 09:58
separate_steps.R
#' Convert a dplyr expression to a list of step objects
separate_steps <- function(expr, iscall=FALSE) {
if (iscall) {
call <- expr
} else {
call <- match.call()[["expr"]]
}
len <- length(call)
if (len == 1) {