- Write commit messages
- If applied, this commit will... "Change that thing"
- i.e.,
git commit -m "Change that thing"
- Use imperative. Capitalize first letter, and no periods at the end.
- Branches and merge
- Create new branch, do stuff, and then merge
git branch new-branch git checkout new-branch
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 program for investigating this property of coins: | |
If Alice tosses a coin until she sees a head followed by a tail, and Bob tosses a coin until he sees two heads in a row, | |
then on average, Alice will require four tosses while Bob will require six tosses (try this at home!), | |
even though head-tail and head-head have an equal chance of appearing after two coin tosses. | |
From https://www.quantamagazine.org/20160313-mathematicians-discover-prime-conspiracy/ | |
""" | |
from numpy.random import randint | |
from sys import argv |
scp
usagescp *.png server:~
Copies all png files from current folder to home directory onserver
(which is a key specified in config) -scp server:~*.png ~/pics
the other way around
- printing at ifi (w/ pullprint)
pullprint [file]
orlpr [file] -P pullprint_ricoh
- Pullprint
- Bash shell shortcuts (from here)
- Ctrl + a: Start of line
- Ctrl + e: End of line
- Ctrl + w: Erase word
I prefer a help rule in the Makefile, like so:
help:
@grep -P '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
Assuming that the trimmed Makefile read:
build: ## Build the binary
clean: ## Clean the binary and intermediate files
if (argc != 2) {
fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
return 0;
}
C-w C-w [file]
split horizontally; open[file]
C-z
: put Vim in the backgroundfg
: put in foreground again[n]dd
: delete[n]
lines (n
defaults to 1) (and store in clipboard)O
: insert line before current line and enter insert modeo
: Same, but after current:w
save%s/old/new/g
: replace all occurrences ofold
withnew
plot(x, y)
+abline(a, b, col="red", lwd=2)
plot(x, y, type="b", col="red", pch=19)
"dotdash" med filledplot(x, y, type="b", col="red")
"dotdash" uten filledrm(list=ls(all=TRUE))
remove stuff- `sapply(.., simplify='array') == unlist(lapply(..))
- save:
C-x C-s
(+ enter) - open file:
C-x C-f
- switch to buffer:
C-x b
- meta key
M
is escape and left alt (option) C-k
: kills from cursor until end of lineC-/
(7) -- undo!C-a
start of lineC-e
start of lineM-f
forward one wordM-b
back one word
plt.savefig(filename, bbox_inches='tight')
--> get the entire plot when saved- Reset to factory default
matplotlib
style
import matplotlib as mpl
mpl.rcParams.update(mpl.rcParamsDefault)
plt.axes('tight')
removes all space around the area of the curveplt.axes('equal')
ensures x-y evenplt.axhline(y=production_accuracy, linewidth=2, color='k', label='production')
horizontal line
OlderNewer