(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| 1) Create a branch with the tag | |
| git branch {tagname}-branch {tagname} | |
| git checkout {tagname}-branch | |
| 2) Include the fix manually if it's just a change .... | |
| git add . | |
| git ci -m "Fix included" | |
| or cherry-pick the commit, whatever is easier | |
| git cherry-pick {num_commit} | |
| ========================================== ========================================== | |
| TMUX COMMAND WINDOW (TAB) | |
| ========================================== ========================================== | |
| List tmux ls List ^b w | |
| New new -s <session> Create ^b c | |
| Attach att -t <session> Rename ^b , <name> | |
| Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
| Kill kill-session -t <session> Close ^b & |
| echo -n "That's the text"|openssl enc -e -aes-256-cbc -a | |
| Encrypt with interactive password. Encrypted message is base64-encoded afterwards. | |
| echo -n "That's the text"|openssl enc -e -aes-256-cbc -a -k "MySuperPassword" | |
| Encrypt with specified password. Encrypted message is base64-encoded afterwards. | |
| echo "GVkYiq1b4M/8ZansBC3Jwx/UtGZzlxJPpygyC"|openssl base64 -d|openssl enc -d -aes-256-cbc | |
| Base-64 decode and decrypt message with interactive password. | |
| echo "GVkYiq1b4M/8ZansBC3Jwx/UtGZzlxJPpygyC"|openssl base64 -d|openssl enc -d -aes-256-cbc -k "MySuperPassword" |
| lmOut <- function(res, file="test.csv", ndigit=3, writecsv=T) { | |
| # If summary has not been run on the model then run summary | |
| if (length(grep("summary", class(res)))==0) res <- summary(res) | |
| co <- res$coefficients | |
| nvar <- nrow(co) | |
| ncol <- ncol(co) | |
| f <- res$fstatistic | |
| formatter <- function(x) format(round(x,ndigit),nsmall=ndigit) | |
Press minus + shift + s and return to chop/fold long lines!
| Title: Download File | |
| Author: RStudio, Inc. | |
| AuthorUrl: http://www.rstudio.com/ | |
| License: MIT | |
| DisplayMode: Showcase | |
| Tags: file-download | |
| Type: Shiny |
| # Customize BASH PS1 prompt to show current GIT repository and branch. | |
| # by Mike Stewart - http://MediaDoneRight.com | |
| # SETUP CONSTANTS | |
| # Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
| # I don't remember where I found this. o_O | |
| # Reset | |
| Color_Off="\[\033[0m\]" # Text Reset |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)| library(tidyverse); library(rstan) | |
| # Some fake data | |
| Individuals <- 1000 | |
| Sims <- 1000 | |
| Months <- 20 | |
| initial_values <- data.frame(customer_id = 1:Individuals, initial_value = rnorm(Individuals)) |