Skip to content

Instantly share code, notes, and snippets.

View jsta's full-sized avatar
🐧
...

Jemma Stachelek jsta

🐧
...
View GitHub Profile
[
{
"name": "SofleKeyboard",
"author": "Josef Adamcik",
"switchMount": "cherry"
},
[
{
"y": 0.2,
"x": 3,
@jsta
jsta / .home-rsync-filter
Created November 6, 2020 13:46 — forked from DarwinAwardWinner/.home-rsync-filter
Example rsync filter file for excluding temp files and stuff
## Rsync Filter for $HOME
# Universal excludes -- These apply to all subdirs
- [Cc]ache
- temp
- tmp
- octave-core
# Emacs temp files
- .#*
@jsta
jsta / gh_file.R
Last active March 2, 2019 19:32 — forked from noamross/gh_file.R
Function to download a file from github via API, including large files and private repos
# https://gist.github.com/noamross/73944d85cad545ae89efaa4d90b049db
#' Gets a file from a github repo, using the Data API blob endpoint
#'
#' This avoids the 1MB limit of the content API and uses [gh::gh] to deal with
#' authorization and such. See https://developer.github.com/v3/git/blobs/
#' @param url the URL of the file to download via API, of the form
#' `:owner/:repo/blob/:path
#' @param ref the reference of a commit: a branch name, tag, or commit SHA
#' @param owner,repo,path,ref alternate way to specify the file. These will
#' override values in `url`
@jsta
jsta / missing.R
Created May 11, 2018 15:32 — forked from ashiklom/missing.R
Multivariate normal fit with missing values in STAN
library(rstan)
library(MASS)
# Simulate some data
mu <- c(10, 5, -5)
Sig <- matrix(c(1, 0.7, 0.8,
0.7, 2, 0.2,
0.8, 0.2, 1.5),
3, 3)
N <- 100
@jsta
jsta / mkrproj.sh
Created January 3, 2018 00:23 — forked from noamross/mkrproj.sh
A bash shell script that can be used to turn the current directory into an RStudio project, opening the project in RStudio after creating it.
#!/bin/bash
# Usage: mkproj [projectname]
# projectname defaults to name of current directory
template="Version: 1.0
RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Yes
@jsta
jsta / upgrade_packages.R
Last active April 26, 2017 16:35 — forked from bearloga/upgrade_packages.R
The script can be used to re-install packages after upgrading R (on Windows), since libraries cannot be reused between different minor versions (e.g. when upgrading 3.2.3 to 3.3.2). It detects when a package was installed from CRAN vs GitHub/Git and re-installs it using the appropriate func. Usage: `Rscript upgrade_packages.R`
#Setup##########################################################################
message("Checking for a personal library...")
if (!dir.exists(Sys.getenv("R_LIBS_USER"))) {
warning("Personal library not found, creating one...")
dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)
message("Registering newly created personal library...")
.libPaths(Sys.getenv("R_LIBS_USER"))
} else {
@jsta
jsta / server.R
Last active August 29, 2015 14:17 — forked from hrbrmstr/server.R
shiny gis
library(shiny)
library(maps)
library(maptools)
library(ggplot2)
library(plyr)
library(XML)
# Define server logic required to plot various variables against mpg
shinyServer(function(input, output, session) {