Skip to content

Instantly share code, notes, and snippets.

View shabbychef's full-sized avatar
tcb

Steven Pav shabbychef

tcb
View GitHub Profile
// [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>
/* d vech(chol(X)) / d vech(X). See mathoverflow.net/a/232129/134083
*
* Args:
* X: symmetric positive definite matrix.
* upper: logical for whether vech denotes the upper triangular part.
*/
// [[Rcpp::export]]
@shabbychef
shabbychef / install_github2.r
Created May 30, 2015 18:47
install_github only once ever.
library(git2r)
library(devtools)
library(drat)
install_github2 <- function(repo) {
dest <- tempfile()
dir.create(dest, recursive=TRUE)
# download
repo <- git2r::clone(paste0('https://github.com/',repo,'.git'),dest)
@nocturnalgeek
nocturnalgeek / MailinatorAliases
Last active April 8, 2024 20:45
A list of alternate domains that point to @mailinator.com
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
@xiaodaigh
xiaodaigh / server.r
Last active February 2, 2016 18:07
R Shiny: An textInput that only gets invalidated upon losing focus or when enter is pressed shiny::runGist("7150112")
library(shiny)
shinyServer(function(input, output, session) {
# Partial example
output$meh <- renderPrint({
print("Press enter or focusout to update --- ")
print(input$myTextInput )
@halpo
halpo / Makefile
Created November 17, 2011 20:07
Makefile for R Packages
# Makefile for generating R packages.
# 2011 Andrew Redd
#
# Assumes Makefile is in a folder where package contents are in a subfolder pkg.
# Roxygen uses the roxygen2 package, and will run automatically on check and all.
PKG_VERSION=$(shell grep -i ^version pkg/DESCRIPTION | cut -d : -d \ -f 2)
PKG_NAME=$(shell grep -i ^package pkg/DESCRIPTION | cut -d : -d \ -f 2)
R_FILES := $(wildcard pkg/R/*.R)