Code TIL

This is updated from time to time to remember things I would otherwise forget.

3/10

  1. 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

  1. Super+O to change tiling orientation counter clockwise for current window!!

2/11

  1. Keep forgetting this:

# Multiple outputs
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"

1/XX

  1. ctrl+super+up/down for changing workspaces

  2. ffmpeg might fail a video to gif conversion if input video is not a multiple of the specified size.

  3. chown [name] [file]

  4. 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.

  5. “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.

  6. shift+tab to move a window between workspaces

  7. 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

  1. shift command v –> paste without formatting

9/10

  1. Not really TIL but mkcd as an alias is v helpful.

function mkcd () {
    mkdir -p "$*"
    cd "$*"
}

9/8

  1. python setup.py install to setup and install a custom personal package!!! Wow beautiful tyvm <3 :) :}

9/3

  1. To select multiple columns at once, use X = data[:, [1, 9]]

8/31

  1. You can pass in a window name to visdom

8/30

  1. shift command L in apple notes to make into a checklist

  2. Command shift E to navigate files in VSC, space to select

  3. Command ` to rotate windows of same app

  4. Cmd option arrow keys to move tabs within an app (iterm, chrome, vsc)

  5. Option click to navigate anywhere in a terminal command

  6. Command arrow keys for ultimate directional move

  7. Option arrow keys for nearest directional move

  8. Arrow keys for smallest directional move

  9. Command tab to rotate apps or selection forward

  10. Command shift tab to rotate apps or selection backward

  11. Command d + selection to also select next appearance of selection in VSC

  12. Control arrow keys to move desktops

8/29

  1. 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

  2. Def map(fn): return lambda lst: [fn(i) for i in lst]

  3. You run hypothesis with pytest