Skip to content

Instantly share code, notes, and snippets.

@t27
t27 / render_json_jupyter_collapsible.py
Last active February 5, 2024 18:40
Render JSON as a collapsible field in jupyter notebooks - Updated - Also includes instructions for interleaving with print statements
## Add this to the first block in your note book
import uuid
from IPython.core.display import display, HTML
import json
class RenderJSON(object):
def __init__(self, json_data):
if isinstance(json_data, dict):
self.json_str = json.dumps(json_data)
@tsherwen
tsherwen / CBcolors.py
Created February 17, 2018 11:59 — forked from thriveth/CBcolors.py
A color blind/friendly color cycle for Matplotlib line plots. Might want to shuffle it around a bit more,but already not it gives kinda good contrasts between subsequent colors, and shows reasonably well in colorblind filters (though not in pure monochrome).
CB_color_cycle = ['#377eb8', '#ff7f00', '#4daf4a',
'#f781bf', '#a65628', '#984ea3',
'#999999', '#e41a1c', '#dede00']
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mikehins
mikehins / reset-local-repo
Last active December 28, 2023 02:39
git: sync local repo with remote one
http://stackoverflow.com/questions/6373277/git-sync-local-repo-with-remote-one
This makes your local repo exactly like your remote repo.
Remember to replace origin and master with the remote and branch that you want to synchronize with.
git fetch origin
git reset --hard origin/master
git clean -f -d
#GIT UNDO