Skip to content

Instantly share code, notes, and snippets.

@mangangreg
mangangreg / gist:c1f4ecae9c4c630b925d654252a859e4
Last active July 6, 2021 22:20
Jupyter Wide (bookmarklet for widescreen jupyter)
javascript:(function(){ var style = document.createElement("style");document.head.appendChild(style);style.sheet.insertRule("#site .container {flex-grow:1;margin:15px;}");style.sheet.insertRule("#notebook, #texteditor-backdrop {display:flex;}");})();
@mangangreg
mangangreg / MongoConnector.py
Last active January 22, 2022 19:00
Mongo Connector
import os
from pathlib import Path
from pymongo import MongoClient
from dotenv import load_dotenv
HERE = Path(__file__).parent
class MongoConnect:
def __init__(self, user=None, password=None, host=None, port=None, database=None, env_file=HERE/'.mongo.env'):
@mangangreg
mangangreg / gpushu.sh
Created April 23, 2021 17:48
Git push from specific user
# Usage `gpushu <username>` from inside of a repo, to push to git from user, will get prompted for password
function gpushu(){
USERNAME=$1
REPO=`git config --get remote.origin.url | awk -F 'com' '{print $2}' | cut -c 2-`
git push "https://$USERNAME@github.com/$REPO"
}