Skip to content

Instantly share code, notes, and snippets.

View LeonardAukea's full-sized avatar
🕵️‍♂️
Alive

Leonard Aukea LeonardAukea

🕵️‍♂️
Alive
View GitHub Profile
@knowsuchagency
knowsuchagency / typecheck.py
Last active January 22, 2024 12:19
A cell magic to enable the use of mypy within jupyter notebooks
"""
Add mypy type-checking cell magic to jupyter/ipython.
Save this script to your ipython profile's startup directory.
IPython's directories can be found via `ipython locate [profile]` to find the current ipython directory and ipython profile directory, respectively.
For example, this file could exist on a path like this on mac:
/Users/yourusername/.ipython/profile_default/startup/typecheck.py
@Wirone
Wirone / .gitconfig
Last active July 16, 2023 15:57
GIT & GitFlow aliases for ~/.gitconfig
# GIT aliases for ~/.gitconfig file
# @author Grzegorz Korba <grzegorz.korba@codito.net>
# Credits: Miscellaneous places on the Internet...
# GitFlow related sections
[gitflow "branch"]
master = master
develop = develop
[gitflow "prefix"]
feature = feature/
@decabyte
decabyte / nb_remove_output.py
Last active December 21, 2023 02:32 — forked from damianavila/remove_output.py
Remove output from Jupyter notebook from the command line
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Remove output from existing Jupyter Notebooks.
Modified from remove_output by Minrk, damianavila, gabraganca.
References:
[0]: https://github.com/jupyter/nbformat
[1]: http://nbformat.readthedocs.org/en/latest/index.html
@pbugnion
pbugnion / ipython_notebook_in_git.md
Last active October 22, 2023 12:25
Keeping IPython notebooks under Git version control

This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.

To use the script, follow the instructions given in the script's docstring.

For further details, read this blogpost.

The procedure outlined here is inspired by this answer on Stack Overflow.

@kalkulus
kalkulus / unzip_all.py
Last active June 8, 2022 11:58
PYTHON: unzip all files in a directory
#!/usr/bin/python
import os, zipfile
for filename in os.listdir("."):
if filename.endswith(".zip"):
print filename
name = os.path.splitext(os.path.basename(filename))[0]
if not os.path.isdir(name):
try:
zip = zipfile.ZipFile(filename)