Skip to content

Instantly share code, notes, and snippets.

@m14t
m14t / fix_github_https_repo.sh
Created July 5, 2012 21:57
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@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
@evilmtv
evilmtv / center_cv2_text.py
Last active December 27, 2021 11:51 — forked from xcsrz/center_text_on_image.py
Center text on an image with Python and OpenCV.
# setup text
font = cv2.FONT_HERSHEY_SIMPLEX
text = "Female"
# get boundary of this text
textsize = cv2.getTextSize(text, font, 1, 2)[0]
# get coords based on boundary
textX = int(boundingboxcenter[0] - (textsize[0] / 2))
textY = int(boundingboxcenter[1] + (textsize[1] / 2))