Arguments pushed on stack, right-to-left.
Caller-saved: eax, ecx, edx. All others are callee-saved.
Return value in eax.
General purpose registers:
- EAX (Accumulator)
| #!/bin/sh | |
| # -n for dry run, --del to delete at dest | |
| # --info and --no-i-r just for showing progress | |
| rsync -avh --del /home/jx --info=progress2 --no-i-r --stats \ | |
| --exclude .local/share/Trash --exclude .cache \ | |
| '/media/jx/Toshiba 2TB/ubuntu_backup_latest' 2> rsync.err |
| #!/bin/env python3 | |
| # Trying to automate android backups but fed up with bash :( | |
| # TODO: Nicer mode selection? | |
| import os | |
| import subprocess | |
| import sys | |
| SD_DIR = "sdcard1" |
| H | |
| He | |
| Li | |
| Be | |
| B | |
| C | |
| N | |
| O | |
| F | |
| Ne |
| " Custom vim config with my comments | |
| " (mostly from the ultimate Vim config amix/vimrc) | |
| " => General | |
| set nocompatible " Disable compatibility mode | |
| set history=1000 " Save more commands | |
| set autoread " Read file when changed externally | |
| set autowrite " Autosave before commands like :make | |
| set noswapfile " No more .swp! |
| # push to new github repo | |
| git remote add origin git@github.com:jxu/repo.git # use set-url if already set | |
| git push -u origin master | |
| # check out a remote branch | |
| git fetch | |
| git branch -v -a # list all branches | |
| git switch branchname | |
| # change remote a branch is tracking |
| -- Syntax order | |
| -- https://learn.microsoft.com/en-us/sql/t-sql/queries/select-transact-sql | |
| WITH cte AS (cte_query) | |
| SELECT cols | |
| FROM table | |
| WHERE cond | |
| GROUP BY col | |
| HAVING cond | |
| WINDOW window_expr |
| import pandas as pd | |
| ### Data import ### | |
| # https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_csv.html | |
| df = pd.read_csv("file.csv") | |
| ### Data types ### |
| # Horizontal bar chart, ordered by value | |
| ggplot(df, aes(x = reorder(name, value), y = value)) + | |
| geom_bar(stat = "identity") + | |
| labs(title = "Title", x = "Name", y = "Value") + | |
| scale_y_continuous(expand = c(0,0)) + | |
| coord_flip() + | |
| theme_light() |