Skip to content

Instantly share code, notes, and snippets.

View jimhester's full-sized avatar

Jim Hester jimhester

View GitHub Profile
@ledell
ledell / meetupr_rladies_budapest_random.R
Last active July 31, 2018 11:36
Randomly select an attendee of a meetup to win a prize! (R-Ladies Budapest Example)
# library(devtools)
# devtools::install_github("rladies/meetupr")
library(meetupr)
# Log in to meetup.com, your key is here: https://secure.meetup.com/meetup_api/key/
api_key <- "YOUR_API_KEY_HERE"
# `urlname` is a human-readable unique id for a meetup, e.g. https://www.meetup.com/R-Ladies-Budapest/
urlname <- "R-Ladies-Budapest"
@jmcphers
jmcphers / exceptionally-good-presentations.txt
Last active June 15, 2018 16:36
How to Give an Exceptionally Good Presentation
"HOW TO GIVE AN EXCEPTIONALLY GOOD PRESENTATION"
CHARACTERS
Joe Cheng.............Moderator
Jennifer Bryan........As Herself
Hadley Wickham........As Himself
Aron Atkins...........Audience
Derrick Kearney.......Audience
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active November 13, 2024 14:50
Hyperlinks in Terminal Emulators
path <- "~/Documents/ingest/readxl/inst/extdata/datasets.xlsx"
zip_file <- function(path) {
stopifnot(file.exists(path))
path <- normalizePath(path)
contents <- utils::unzip(path, list = TRUE)
names(contents) <- c("path", "size", "date")
contents <- contents[contents$size > 0, , drop = FALSE]
@ericclemmons
ericclemmons / example.md
Last active September 20, 2024 12:46
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here

VIM FOR ADULTS

CHAPTER ONE: STOP TYPING

intro/stuff you should already know

what is vim?

  • based on very old editor (vi) designed in the days when connections were slow
  • installed on almost every *nix system, incl. os x
  • organic growth since to include hundreds of modern features
@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")]
@wch
wch / locale.R
Created December 18, 2015 15:31
Multibyte non-UTF-8 locales
# ==== Creating UTF-8 strings ====
# This is how to create a string with UTF-8 encoding. This should work
# regardless of the current locale settings.
x <- rawToChar(as.raw(c(0xe5, 0x8d, 0x88)))
Encoding(x) <- "UTF-8"
x
# [1] "午"
# Another string, 'Δ★😎'
pat <- rawToChar(as.raw(c(0xce, 0x94, 0xe2, 0x98, 0x85, 0xf0, 0x9f, 0x98, 0x8e)))
@jeroen
jeroen / encrypt.R
Last active January 14, 2016 14:01
Encrypt with github key
# Send Gabor an encrypted message
library(openssl)
library(jsonlite)
# Get Gabor's pubkey
keydata <- fromJSON("https://api.github.com/users/gaborcsardi/keys")
cat("Number of keys:", nrow(keydata), "\n")
pubkey <- read_pubkey(textConnection(keydata$key[1]))
print(pubkey)
@aronatkins
aronatkins / install-rstudio-daily.sh
Last active February 10, 2022 08:54
Install RStudio daily build on OSX/macOS or Ubuntu Linux
#!/bin/bash
#
# Installs the latest RStudio daily desktop build for OSX/macOS and Ubuntu(amd64)
#
# https://support.rstudio.com/hc/en-us/articles/203842428-Getting-the-newest-RStudio-builds
set -e
install_macos_daily() {
REDIRECT_URL="https://www.rstudio.org/download/latest/daily/desktop/mac/RStudio-latest.dmg"