Skip to content

Instantly share code, notes, and snippets.

eyJhIjoiY2Q3MDQ4N2NjMTRlODgyZGNiMjE5N2QwNWJiNjYwMTUiLCJ0IjoiMmIyMzg2NGYtZTRjNy00MTNjLTg4NjctNmZiNWYwNDM3ZTFkIiwicyI6IlpHSTNZekEzTjJFdE1USTRNaTAwTW1Ka0xXRTNOR0V0Tm1ReVpEUmtaVEJsT1RGbSJ9
@Souldiv
Souldiv / delete_git_submodule.md
Created October 13, 2023 04:45 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
import seaborn as sns
import matplotlib.pyplot as plt
# For Notebooks
%matplotlib.pyplot as plt
def make_plot(y_true, y_pred):
df_cm = confusion_matrix(y_true, y_pred)
sns.set()
_ = sns.heatmap(df_cm, annot=True)
def conv_output_shape(h_w, kernel_size=1, stride=1, pad=0, dilation=1):
"""
Utility function for computing output of convolutions
takes a tuple of (h,w) and returns a tuple of (h,w)
"""
if type(h_w) is not tuple:
h_w = (h_w, h_w)
if type(kernel_size) is not tuple:
@Souldiv
Souldiv / tornado_cookie_secret_generator.py
Created October 11, 2017 14:11 — forked from didip/tornado_cookie_secret_generator.py
Generates secure cookie secret for Tornado Web Framework