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
cat .Rprofile | |
# setup R lib path --------- | |
#.libPaths("/home/sseth/R/x86_64-pc-linux-gnu-library/4.0") | |
vs = version | |
rver = paste0(vs$major, ".", strsplit(vs$minor, split = "\\.")[[1]][1]) | |
# utils::osVersion | |
sess = utils::sessionInfo() | |
os = switch(sess$running, |
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
override legend | |
# get it inside the plot, and remove alpha | |
theme(legend.position = c(0, 0.2), | |
legend.background = element_blank()) + | |
guides(colour = guide_legend(override.aes = list(alpha = 1))) |
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
# the following two lines give a two-line status, with the current window highlighted | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' | |
# huge scrollback buffer | |
defscrollback 5000 | |
# no welcome message | |
startup_message off |
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
## cursor size: | |
settings >> universal access |
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
# job details | |
bhist -l 707919 | |
# prioritize jobs, move them to the TOP | |
top_jobs=$(bjobs | grep shrna | grep PEND | awk '{print $1}') | |
for job in $top_jobs; do btop $job; done | |
# change the resources (change cpu reqt to 4) | |
bmod -R span[ptile=4] -n4 707919 |
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
yesno <- function(...) { | |
yeses <- c("Yes", "Definitely", "For sure", "Yup", "Yeah", | |
"I agree", "Absolutely") | |
nos <- c("No way", "Not yet", "I forget", "No", "Nope", "Uhhhh... Maybe?") | |
qs <- c(sample(yeses, 1), sample(nos, 2)) | |
rand <- sample(length(qs)) | |
cat(paste0(..., collapse = "")) | |
menu(qs[rand]) == which(rand == 1) |
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
#' expand_grid | |
#' @export | |
expand_grid <- function(x, y, remove_diag = TRUE){ | |
x1 <- seq_along(x) | |
y1 <- seq_along(y) | |
ex <- expand.grid(x1, y1) | |
ex <- ex[ex[,2]>=ex[,1],] |
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
col20 = list("Red" = c("#e6194b", "(230, 25, 75)", "(0, 100, 66, 0)"), | |
"Green" = c("#3cb44b", "(60, 180, 75)", "(75, 0, 100, 0)"), | |
"Yellow" = c("#ffe119", "(255, 225, 25)", "(0, 25, 95, 0)"), | |
"Blue" = c("#0082c8", "(0, 130, 200)", "(100, 35, 0, 0)"), | |
"Orange" = c("#f58231" , "(245, 130, 48)", "(0, 60, 92, 0)"), | |
"Purple" = c("#911eb4" , "(145, 30, 180)", "(35, 70, 0, 0)"), | |
"Cyan" = c("#46f0f0" , "(70, 240, 240)", "(70, 0, 0, 0)"), | |
"Magenta" = c("#f032e6" , "(240, 50, 230)", "(0, 100, 0, 0)"), | |
"Lime" = c("#d2f53c" , "(210, 245, 60)", "(35, 0, 100, 0)"), | |
"Pink" = c("#fabebe" , "(250, 190, 190)", "(0, 30, 15, 0)"), |
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
# get it inside the plot, and remove alpha | |
theme(legend.position = c(0, 0.2), | |
legend.background = element_blank()) + | |
guides(colour = guide_legend(override.aes = list(alpha = 1))) + |
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
#source("https://gist.githubusercontent.com/sahilseth/5dcc71cf2b563edca9b56e2d920543be/raw/re_install_r_pkgs.R") | |
pkgs = unlist(read.table("~/Dropbox/misc/Rpkgs.txt", stringsAsFactors = FALSE)) | |
# idea1 (works) | |
ins = installed.packages()[, 1] | |
need_pkgs = pkgs[which(is.na(match(pkgs, ins)))] | |
length(need_pkgs) | |
need_pkgs |
NewerOlder