Code TIL¶
This is updated from time to time to remember things I would otherwise forget.
3/10
For image placement in latex you can use negative margins, and create a grid of images using {tabular}.
\begin{center}
\hspace*{-.95in}
\begin{tabular}{llll}
\includegraphics[width=.65\textwidth, halign=m]{mopsratio.png}
& \includegraphics[width=.65\textwidth, halign=m]{mopsssd.png}
\\
\includegraphics[width=.65\textwidth, halign=m]{simpleratio.png}
& \includegraphics[width=.65\textwidth, halign=m]{simplessd.png}
\end{tabular}
\end{center}
2/26
Super+O to change tiling orientation counter clockwise for current window!!
2/11
Keep forgetting this:
# Multiple outputs
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
1/XX
ctrl+super+up/down for changing workspaces
ffmpeg might fail a video to gif conversion if input video is not a multiple of the specified size.
chown [name] [file]
An apple journaled external drive should have journaling turned off to be used multi-platform since Apple’s journaling is proprietary. Turn off so it’s only hfs+ in an apple terminal.
“fsck” can be used to fix minor errors like eject without unmount of a drive, which might cause a drive to remount as read-only, without write access.
shift+tab to move a window between workspaces
shift+w to detach firefox tab with vimium
[Gap from switching operating systems and holiday break] Most commands still useful, just swap cmd with ctrl.
10/2
shift command v –> paste without formatting
9/10
Not really TIL but mkcd as an alias is v helpful.
function mkcd () {
mkdir -p "$*"
cd "$*"
}
9/8
python setup.py install to setup and install a custom personal package!!! Wow beautiful tyvm <3 :) :}
9/3
To select multiple columns at once, use X = data[:, [1, 9]]
8/31
You can pass in a window name to visdom
8/30
shift command L in apple notes to make into a checklist
Command shift E to navigate files in VSC, space to select
Command ` to rotate windows of same app
Cmd option arrow keys to move tabs within an app (iterm, chrome, vsc)
Option click to navigate anywhere in a terminal command
Command arrow keys for ultimate directional move
Option arrow keys for nearest directional move
Arrow keys for smallest directional move
Command tab to rotate apps or selection forward
Command shift tab to rotate apps or selection backward
Command d + selection to also select next appearance of selection in VSC
Control arrow keys to move desktops
8/29
You can write higher order functions where the function returns a lambda function that expects an input that the initial function didn’t, this resultant function will then expect it from wherever it is nested in
Def map(fn): return lambda lst: [fn(i) for i in lst]
You run hypothesis with pytest