Skip to content

Instantly share code, notes, and snippets.

View ncarchedi's full-sized avatar

Nick Carchedi ncarchedi

  • Datafold
  • Denver, CO
View GitHub Profile
@ncarchedi
ncarchedi / cloudSettings
Last active October 6, 2020 14:23
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-10-06T14:23:06.162Z","extensionVersion":"v3.4.3"}

Keybase proof

I hereby claim:

  • I am ncarchedi on github.
  • I am n10i (https://keybase.io/n10i) on keybase.
  • I have a public key ASDUJBvM1uS2YIEbzJMzv2dZNIJhEX-jFyyxx5PGv-iFago

To claim this, I am signing this object:

@ncarchedi
ncarchedi / test.md
Created September 15, 2017 19:56
Example of line breaks between paragraphs

This is an example paragraph.

And here's another. Notice the amount of space between paragraphs, which makes the text more readable (especially when there's lots of it).

@ncarchedi
ncarchedi / server.R
Last active May 13, 2019 03:38
Dynamically append arbitrary number of inputs (Shiny)
library(shiny)
shinyServer(function(input, output) {
# Initialize list of inputs
inputTagList <- tagList()
output$allInputs <- renderUI({
# Get value of button, which represents number of times pressed (i.e. number of inputs added)
i <- input$appendInput
@ncarchedi
ncarchedi / autoSave.R
Created November 10, 2013 22:59
This short R script initiates a callback function called saveWork. Every time a valid R command is executed in the console, the user's workspace will be automatically saved to the usual .Rdata file in the current working directory. This is particularly useful if the user is concerned about losing his or her work due to computer or software insta…
saveWork <- function(...) {
save.image()
TRUE
}
addTaskCallback(saveWork, name="autoSave")
@ncarchedi
ncarchedi / sounds.r
Created November 2, 2013 13:56 — forked from pschulam/sounds.r
# Script to help understanding of S3 object-oriented programming
# in R using classes and methods
# Constructor functions for various classes of animal
pig <- function() structure(list(), class=c("pig", "animal"))
dog <- function() structure(list(), class=c("dog", "animal"))
cat <- function() structure(list(), class=c("cat", "animal"))
makeSound <- function(x) UseMethod("makeSound")
@ncarchedi
ncarchedi / s3intro.R
Last active January 8, 2016 04:45
Script to help understanding of S3 object-oriented programming in R using classes and methods
# Script to help understanding of S3 object-oriented programming
# in R using classes and methods
# Constructor functions for various classes of animal
pig <- function() structure(list(), class="pig")
dog <- function() structure(list(), class="dog")
cat <- function() structure(list(), class="cat")
# Generic makeSound function
makeSound <- function(x) UseMethod("makeSound")
@ncarchedi
ncarchedi / frndly.r
Created October 12, 2013 15:12 — forked from hadley/frndly.r
# A tutorial navigates through a series of states, either manually, with
# nxt(), prv(), jmp() etc, or automatically, by using addTaskCallback() and
# checking that preconditions are met.
#
# Each state has:
# * a message
# * a next state (a function name)
# (eventually may have multiple next named states)
# * an auto test
#