Action | Notepad++ shortcut | Vim shortcut |
---|---|---|
Duplicate line | Ctrl+D |
yyp |
Cut line | Ctrl+L |
dd |
Move line up/down | Ctrl+Shift+<up/down> |
dd<k/j>p |
Compare files | File compare plugin wizard | :vsplit <filename> or vimdiff file1 file2 (from command line) |
Select all (from here to top/bottom of file) | Ctrl+Shift+<home/end> |
v<gg/G> |
Select all (from here up/down one page) | Ctrl+Shift+ |
v Ctrl+ |
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
library(tidyverse) | |
library(openai) | |
#------------------------------------------------------------------------------- | |
# Step 1: Open AI API key | |
#------------------------------------------------------------------------------- | |
# Your OpenAI API key should be an environment variable you set in ~.Renviron | |
# ... you should never put your API key directly in your code! |
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
echo "Downloading gcc source files..." | |
curl https://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2 -O | |
echo "extracting files..." | |
tar xvfj gcc-5.4.0.tar.bz2 | |
echo "Installing dependencies..." | |
yum install gmp-devel mpfr-devel libmpc-devel | |
echo "Configure and install..." |
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
using Statistics, BenchmarkTools, DataFrames, Random | |
Random.seed!(1234) | |
mutable struct allParmsM | |
x::Float64 | |
end | |
# fill in the mutable struct with the values | |
allpM = allParmsM( | |
5.784 # x |
- Sections and subsections numbered like "II.A.1" (add following to end of preamble)
-
\renewcommand{\thesection}{\Roman{section}}
-
\renewcommand{\thesubsection}{\thesection.\Alph{subsection}}
-
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
-
- roman numeraled endnotes instead of footnotes (add following to preamble)
- \usepackage{endnotes}
- \let\footnote=\endnote
- \renewcommand{\theendnote}{\roman{endnote}}
- put "\theendnotes" just before the online appendix
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
* Dodging local macros (backtick) | |
* works | |
file open tb using "test1.tex", write replace | |
file write tb "These are backticks: " "`" "`" "air quotes''. "_n | |
file close tb | |
* works | |
!echo "These are backticks:" "`=char(92)'`=char(96)'""`=char(92)'`=char(96)'""air quotes''." > test2.tex |
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
library(ggplot2) | |
# create a matrix with the given points | |
pts <- matrix(c(3, 3, 3, 3, 3, 3, 3, 0.5, -1, -3, 1, 1.5, 2.75, 3, 1.25, 1.75, 0, 4, 8, 12, 16, 20, 23, 24, 25, 37, 38.5, 48, 60, 69, 71, 84), ncol = 2, byrow = F) | |
# sort the points by x value | |
pts <- pts[order(pts[, 2]), ] | |
# create the spline interpolation function | |
interp <- splinefun(pts[, 2], pts[, 1], method = "natural") |
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
library(NHANES) | |
library(tidyverse) | |
library(magrittr) | |
library(modelsummary) | |
df <- as_tibble(NHANES) | |
datasummary_skim(df, type="categorical") | |
datasummary_skim(df, type="numeric") |
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
#!/bin/bash | |
#Download source | |
wget http://mirrors.concertpass.com/gcc/releases/gcc-4.7.2/gcc-4.7.2.tar.bz2 | |
tar xvfj gcc-4.7.2.tar.bz2 | |
cd gcc-4.7.2 | |
./contrib/download_prerequisites | |
#Download and apply fix to be able to build GCC 4.7 with GCC 5.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
library(tidyverse) | |
library(magrittr) | |
library(pdftools) | |
# get a timeline of movement to test optional from fairtest.org | |
# url accessed on 30 Jun 2022 | |
optl <- pdf_text(pdf = "https://www.fairtest.org/sites/default/files/Optional-Growth-Chronology.pdf") %>% str_split('\n') | |
optdf <- list() | |
for (i in seq(1:18)) { | |
print(length(optl[[i]])) |
NewerOlder