Skip to content

Instantly share code, notes, and snippets.

Patrick Ball vm-wylbur

Block or report user

Report or block vm-wylbur

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vm-wylbur
vm-wylbur / running_script.R
Created Jan 1, 2019
get name of the running script in R (or RStudio)
View running_script.R
.get_running_name <- function() {
#' returns name of current script
if (interactive()) {
fname <- rstudioapi::getActiveDocumentContext()$path
} else {
# via commandArgs, look for file=
cmdArgs = commandArgs(trailingOnly = FALSE)
needle <- '--file='
fname <- grep(needle, cmdArgs, value=TRUE)
}
@vm-wylbur
vm-wylbur / thin-space.R
Created Jan 1, 2019
use non-breaking thin space as thousands separator in rmarkdown
View thin-space.R
myNum <- function(n) {
# use in markdown with variable some_number:
# `r myNum(some_number)` and the thousands separator is a
# nonbreaking thin space, which is ISO 30-1
return(prettyNum(n, big.mark='&thinsp;'))
}
@vm-wylbur
vm-wylbur / Makefile
Created Jan 1, 2019
create LaTeX from Rmd, using a Makefile, the HRDAG way
View Makefile
#
# Authors: PB
# Maintainers: PB
# Copyright: 2018, HRDAG, GPL v2 or later
# ============================================
R_OPTS=--no-save --no-restore --no-init-file --no-site-file
KNITR="rmarkdown::render('$<', output_format='md_document', output_dir='output/')"
all: output/some-file.tex \
View getpix.py
#!/usr/bin/env python3
# set expandtab ts=4 sw=4 ai fileencoding=utf-8
#
# Author: PB
# Maintainer(s): PB
# License: (c) HRDAG 2019, GPL v2 or newer
#
# -----------------------------------------------------------
# archiver/bin/getpix.py
@vm-wylbur
vm-wylbur / noise_noise.ino
Created Sep 6, 2019 — forked from StefanPetrick/noise_noise.ino
The complete code for the noise controlled noise.
View noise_noise.ino
/*
A FastLED matrix example:
A simplex noise field fully modulated and controlled by itself
written by
Stefan Petrick 2017
Do with it whatever you like and show your results to the FastLED community
https://plus.google.com/communities/109127054924227823508
*/
#include "FastLED.h"
You can’t perform that action at this time.