Skip to content

Instantly share code, notes, and snippets.

View SHDShim's full-sized avatar

S.-H. Dan Shim SHDShim

View GitHub Profile
@SHDShim
SHDShim / HowToRunPytheosInJupyter.md
Last active April 2, 2018 16:30
Local machine instruction for the COMPRES workshop attendees

How to install Anaconda, Jupyter notebook, and Pytheos (for the 2017 COMPRES workshop attendees)

(Important) Unlike your typical apps, most of the following procedures are all happening in terminal (osx) or command line (windows). So if you are not familiar with terminal or command line, please find a short instruction video on these in YouTube and watch it before you start the procedure below.

Install Anaconda

  • Download Anaconda from https://www.continuum.io/downloads for your OS. I recommend to download the graphical installer for Python v3.6.

  • Run the downloaded graphical installer. Do not change any default settings during installation. It is important to choose the Just me option for the install location of Anaconda. If you install for all users, you may experience some permission issues.

How to download my gist postings.

Check this out.

Conda update problem

I found that the following command does not update to the latest. I got stuck at 4.3.x while the newest was 4.5.0.

conda update -n root conda

Once I do the following, I can get rid of the problem.

@SHDShim
SHDShim / clean_tarballs.md
Last active April 2, 2018 17:27
conda, anaconda, python

How to clean up tarballs in conda

conda occupies some space in your hard drive. Over certain period of time, they become quite bigger in size. To free some space by deleting tarball files:

conda clean -t
@SHDShim
SHDShim / sphinx_tutorial.md
Last active April 2, 2018 17:27
sphinx, python, github, manual

Short and easy tutorial for Sphinx

Sphinx is a powerful python tool to automatically generate manual html files for posting. However, it looks quite scary to use if you read regular tutorial. I found the tutorial linked below is really helpful for me to start. Just provide docstring, then sphinx will take care of it.

This works great: https://gisellezeno.com/tutorials/sphinx-for-python-documentation.html

@SHDShim
SHDShim / Latex_todo.md
Last active April 4, 2018 20:42
latex, todo, package

How to setup latex todo package for comments

The todo package provides powerful commenting options for latex writers. I made some setups to fit to my flavor.

I used this setup since early 2018. This makes three different kinds comments: inline comment, urgent comment (inline but with an orange color), and side comment.

(Note) Make sure you include the setspace package.

\usepackage{hyperref}
@SHDShim
SHDShim / faster_post_save_hook_jupyter_notebook.md
Last active January 13, 2021 16:41
jupyter notebook, python, html, git

Faster post save hook for Jupyter notebook

ipynb files are great but difficult to share with colleagues. Often it is also convenient if I can quickly read the codes in ipynb files without running jupyter notebook. You can make jupyter notebook to save contents in html and py files when you save ipynb file. You just need to make a file and place it under your home folder. See the instruction below.

The code below provides faster and better post save hook for *.py and *.html. Unfortunately I do not remember the source.

This needs to be saved as jupyter_notebook_config.py under the ~/.jupyter folder.

import io
@SHDShim
SHDShim / book_on_git.md
Last active April 2, 2018 17:26
git, book, github

My favorite book on git - Pro Git

I spend a half afternoon at local bookstore with Pro Git. I am still learning a lot but the book taught me a lot about basics for very short period of time.

It is avialalbe as an online material here: https://git-scm.com/book/en/v2

@SHDShim
SHDShim / GSECARS_github.md
Created April 2, 2018 17:35
GSECARS, github, synchrotron
@SHDShim
SHDShim / Helvetica_font_in_matplotlib.md
Last active September 10, 2024 09:16
matplotlib, jupyter notebook, helvetica

How to setup helvetica font in matplotlib

Helvetica is the standard font for scientific plots. However, the default for matplotlib is not helvetica. You can use the following tutorial for making the change.

[Update in 2022/11/11]

Just have the following line in the beginning of a notebook will take care of the problem.

%config InlineBackend.figure_format='svg'