Skip to content

Instantly share code, notes, and snippets.

View carlganz's full-sized avatar

Carl Ganz carlganz

View GitHub Profile
@silkentrance
silkentrance / MyComponent.ts
Last active March 10, 2021 13:09
vue-router typescript integration fails
import Vue from 'vue';
import Component from 'vue-class-component';
@Component({
name : 'component'
})
export default class MyComponent extends Vue {
beforeCreate() {
@jcheng5
jcheng5 / app.R
Last active February 3, 2024 17:34
Using OAuth2 with Shiny
library(shiny)
# WARNING: This sketch does not make proper use of the "state" parameter.
# Doing so usually involves using cookies, which can be done with the
# Rook package but I have not done that here. If you choose to use this
# approach in production, please check the state parameter properly!
APP_URL <- if (interactive()) {
# This might be useful for local development. If not, just hardcode APP_URL
# to the deployed URL that you'll provide a few lines below.
@PeterVermont
PeterVermont / ..FutureProcessorWithShinyExample.md
Last active December 7, 2020 19:18
FutureProcessor.R is a self contained utility for dispatching and tracking future tasks and supports callbacks and extensive (optional) output. app.R is a Shiny app that uses FutureProcessor.R to show how to use it within Shiny.

FutureProcessorWithShinyExample: An asynchronous task processor using the R Future library https://github.com/HenrikBengtsson/future

FutureProcessor.R is a self contained utility for dispatching and tracking future tasks and supports callbacks and extensive (optional) output. app.R is a Shiny app that uses FutureProcessor.R to show how to use it within Shiny.

@kevinushey
kevinushey / apply_mean.cpp
Last active April 14, 2019 06:23
row, column-wise operations in Rcpp
// the column-wise implementation is just as fast as colMeans,
// but the row-wise operation is not quite as fast as rowMeans.
// can I do better?
#include <Rcpp.h>
using namespace Rcpp;
template <class T>
inline double do_mean( T& x ) {
@mages
mages / gist:1544009
Created December 31, 2011 13:30
Search and replace string across files with R
## The following example demonstrates
## how a serach and replace string task
## can be peformed with R across several files
## Create two text files with content
filenames <- c( tempfile(), tempfile() )
for( f in filenames ){
cat("We wish you a Merry Christmas!\n\nBest regards\n", file=f)
}