Skip to content

Instantly share code, notes, and snippets.

Adam Gagorik AdamGagorik

  • United States
View GitHub Profile
View create_subplots.py
def create_subplots(n_row, n_col, cell_w=5.0, cell_h=5.0, sep_w=1.0, sep_v=1.0,
ls=1.0, rs=1.0, ts=1.0, bs=1.0):
"""
Create subplot grid using absolute widths.
Parameters:
n_row (int): rows in subplot grid
n_col (int): columns in subplot grid
cell_w (float): width of each cell
cell_h (float): height of each cell
@AdamGagorik
AdamGagorik / remote-jupyter-notebook.md
Last active May 21, 2020
Remote Jupyter Notebook
View remote-jupyter-notebook.md

Description

Use these commands to run a jupyter server on a remote server and access it locally in a browser. You must have SSH access to the browser. Use any port you want.

Do not forget to change username@server to the correct value!

TLDR

where using command
View CreateDocumentParameter.tex
\makeatletter
\DeclareDocumentCommand{\setvalue}{m o m}{%
\IfNoValueTF{#2}{%
% NO INDEX
\expandafter\DeclareDocumentCommand\csname @#1\endcsname{}{#3}%
}{%
% INDEX
\expandafter\DeclareDocumentCommand\csname @#1@#2\endcsname{}{#3}%
}%
}%
@AdamGagorik
AdamGagorik / tar
Last active Sep 17, 2015
Create and extract tar archives
View tar
# create
tar -cvf output.tar input/*
gzip output.tar
# The name of the tar, "output.tar", does not matter.
# When extracted, the files will expand into a directory named "input".
# extract
tar -xvf output.tar
@AdamGagorik
AdamGagorik / stub
Last active Sep 17, 2015
Extract stub from file name in bash.
View stub
stub=${file%.*}
@AdamGagorik
AdamGagorik / ext
Last active Sep 17, 2015
Extract extension from file name in bash.
View ext
ext=${file##*.}
@AdamGagorik
AdamGagorik / gs-reprint
Last active Sep 17, 2015
Make PDF smaller
View gs-reprint
gs -sDEVICE=pdfwrite -sPAPERSIZE=letter -dFIXEDMEDIA -dPDFFitPage -dCompatibilityLevel=1.4 -o out.pdf in.pdf
You can’t perform that action at this time.