Skip to content

Instantly share code, notes, and snippets.

@nimaid
nimaid / install_conda.bat
Last active April 28, 2024 11:57
Batch script to install Miniconda on Windows without user input
@echo off
set ORIGDIR="%CD%"
set MINICONDAPATH=%USERPROFILE%\Miniconda3
set CONDAEXE=%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%-condainstall.exe
set "OS="
set "MCLINK="
where conda >nul 2>nul
@jmclong
jmclong / jupyter_notebook_config.py
Created August 26, 2021 19:03
Save a copy of a Jupyter notebook in a '.history' folder every time the notebook is saved
import os
import shutil
import pathlib
from datetime import datetime
def post_save(model, os_path, contents_manager):
"""post-save hook for saving backups of jupyter files."""
if model['type'] != 'notebook':
return # only do this for notebooks
directory, filename = os.path.split(os_path)