Skip to content

Instantly share code, notes, and snippets.

@33eyes
33eyes / render_plotly_in_jupyterlab_on_sagemaker.py
Last active March 22, 2022 02:50
How to render Plotly in Jupyterlab on SageMaker
from IPython.display import HTML
import plotly.express as px
# Create Plotly fig objects in plotly as usual, and then use HTML(fig.to_html()) to render them in Jupyterlab on SageMaker.
# Or just write to html file: fig.write_html("fig.html") and view it.
@33eyes
33eyes / commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
Last active November 10, 2024 21:35
How to commit jupyter notebooks without output to git while keeping the notebooks outputs intact locally

Commit jupyter notebooks code to git and keep output locally

  1. Add a filter to git config by running the following command in bash inside the repo:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'  
  1. Create a .gitattributes file inside the directory with the notebooks

  2. Add the following to that file:

@33eyes
33eyes / jupyter_notebook_w_nohup.md
Last active April 9, 2024 08:56
Jupyter notebook with nohup

Running jupyter notebook with nohup

This is helpful when running jupyter notebook on remote server (AWS) and tunneling into it, because with nohup the notebook process continues to run on the server even if you get disconnected from it (any running notebook code continues to run on the server without interruption, and just needs to be re-tunneled into).

Start jupyter notebook on remote server

In the remote server terminal, run:

nohup jupyter notebook &
@33eyes
33eyes / ubuntu_vm_customizations.md
Last active January 5, 2018 05:04
Setting up Ubuntu Vitrual Machine on Windows 10 64-bit host PC