Create new session
tmux new -s session_name
Disattach session
ctrl+b, then d
Attach session
tmux a -t session_name
Start interactive session with specific memory and cpus
Create new session
tmux new -s session_name
Disattach session
ctrl+b, then d
Attach session
tmux a -t session_name
Start interactive session with specific memory and cpus
## add new remote
git remote add temp_origin <<remote address>>
## push/pull as needed
git push temp_origin branch-name
git pull temp_origin branch-name
## switching back (assuming usual remote is called origin, check via git remote -v
git push origin branch-namef, ax = plt.subplots(1,1,figsize=(5,5))
cols= ["black", "red"]
for lidx, lvl in enumerate(["high", "low"]):
ttdf = behdf.loc[behdf["TF2_PhysiolAnx_ms"].isin([lvl])]
sns.regplot(data=ttdf, x="prob_safe", y="shnosh_diff_mflr", color=cols[lidx], ax=ax)
corrfunc(ttdf["prob_safe"], ttdf["shnosh_diff_mflr"], tests=[ "spearman"], drop_missing=True, xanchor=0.4, yanchor=0+lidx*0.06, boxcolor=cols[lidx])where corrfunc() is
# where m is an estimated model
pars <- parameters(m)
pars <- pars %>% mutate(sig = case_when(p<0.05 ~ "sig",
p>=0.05 ~ "nonsig"))
g<- plot(pars) + scale_color_manual(values = c("black", "red"))
# A bit hacky, one needs to set the quosure expression manually like this, this basically changes the mapping of the aes from the default (CI in plot()) to `sig`
g$mapping$colour<-quo_set_expr(g$mapping$colour, expr=expr(.data$sig))
print(g)generate_equation <- function(dep_var, vec_to_iterate, vec_interactions, other_terms, reffs) {
eq <- ""
eq <- paste0(dep_var, " ~ ")
eff1 <- paste(vec_to_iterate, sep="", collapse=" + ")
eq <- paste0(eq, eff1)
for (i in vec_interactions) {
eff2 <- paste0(paste(vec_to_iterate, sep="+", collapse=paste0("*", i, " + ")), paste0("*", i))
eq <- paste(eq, eff2, sep=" + ", collapse=" + ")| ### Split by quantile | |
| import numpy as np | |
| import pandas as pd | |
| col = np.arange(17) | |
| a = pd.DataFrame(col, columns=["tt"]) | |
| a['tricut_2'] = pd.qcut(a['tt'], [0, .33, .66, 1],labels=['low', 'mid', 'high']) | |
| a | |
| ### Demean |
| ## PREP STEPS | |
| # disable sudo prompt | |
| #sudo visudo | |
| sudo apt install -y vim | |
| sudo update-alternatives --config editor | |
| sudo apt install -y curl | |
| ## UPDATE & UPGRADE ## | |
| sudo apt update |
Go to user's ssh key location (normaly ~/.ssh)
ssh-keygen -t ed25519 -C "dubovy.prkno@email.com"
name it: <<local>>_2_<<remote>> (e.g. ondrej_2_gitlab this is just my silly convention)
This creates two files, the private key (which should only stay on your computer) and the public key (
<<NAME>>*.pubwhich you will need to copy and add to the remote server).
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/<>
datalad create -f [folder]
.gitignore