This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Setup | |
Sys.setenv(CUDA_VISIBLE_DEVICES='') | |
options(tensorflow.extract.warn_tensors_passed_asis = FALSE) | |
library(dplyr, warn.conflicts = FALSE) | |
library(purrr) | |
library(glue) | |
library(envir) | |
library(tensorflow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`%(%` <- function(fn, args) { | |
fn <- substitute(fn) | |
args <- as.list(substitute(args)) | |
if(!identical(args[[1]], quote(`{`))) | |
stop("right hand side must be an expressionlist starting with a `{`") | |
args[[1L]] <- NULL | |
nms <- names2(args) | |
for(i in seq_along(args)) { | |
ar <- args[[i]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# VSCode Nautilus Extension | |
# | |
# Place me in ~/.local/share/nautilus-python/extensions/, | |
# ensure you have python-nautilus package, restrart Nautilus, and enjoy :) | |
# | |
# Quick install command: | |
# mkdir -p ~/.local/share/nautilus-python/extensions && cp -f VSCodeExtension.py ~/.local/share/nautilus-python/extensions/VSCodeExtension.py && nautilus -q | |
# | |
# Quick download + install command: | |
# wget https://gist.githubusercontent.com/cra0zy/f8ec780e16201f81ccd5234856546414/raw/6e53c15ea4b18de077587e781dc95dc7f0582cc3/VSCodeExtension.py && mkdir -p ~/.local/share/nautilus-python/extensions && cp -f VSCodeExtension.py ~/.local/share/nautilus-python/extensions/VSCodeExtension.py && rm VSCodeExtension.py && nautilus -q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modified from http://adv-r.had.co.nz/dsl.html | |
.wrap_bare_symbols_with_make_unit_call <- function(x) { | |
if (is.atomic(x)) { | |
x | |
} else if (is.name(x)) { | |
chr <- as.character(x) | |
if(!udunits2::ud.is.parseable(chr)) | |
stop("could not parse ", dbl_quote(chr)) | |
bquote(units::make_unit(.(as.character(x)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### A piper diagram based on the ternary plot example here: http://srmulcahy.github.io/2012/12/04/ternary-plots-r.html | |
### This was written quickly, and most likely contains bugs - I advise you to check it first. | |
### Jason Lessels [email protected] | |
### This now consists of two functions. transform_piper_data transforms the data to match | |
### the coordinates of the piper diagram. ggplot_piper does all of the background. | |
transform_piper_data <- function(Mg, Ca, Cl,SO4, name=NULL){ | |
if(is.null(name)){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g_LastCtrlKeyDownTime := 0 | |
g_AbortSendEsc := false | |
g_ControlRepeatDetected := false | |
*CapsLock:: | |
if (g_ControlRepeatDetected) | |
{ | |
return | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doInstall <- TRUE # Change to FALSE if you don't want packages installed. | |
toInstall <- c("ggplot2", "proxy") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
nIncrements <- 36 | |
eachIncrement <- seq(0, 1, len = nIncrements) | |
colorSweep <- expand.grid(eachIncrement, eachIncrement, eachIncrement) | |
moduloRemainder <- with(colorSweep, Var1*(nIncrements-1)) %% | |
floor(sqrt(nIncrements)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/) | |
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/ | |
# | |
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything | |
# | |
# Alternative to http://www.groths.org/trim-enabler-3-0-released/ | |
# Method behind this madness described: http://forums.macrumors.com/showthread.php?t=1409151&page=4 | |
# See discussion in comments here: https://www.macupdate.com/app/mac/39654/lion-tweaks | |
# And here: http://forums.macrumors.com/showthread.php?t=1410459 |