Skip to content

Instantly share code, notes, and snippets.

View amazingsmash's full-sized avatar

José Miguel Santana amazingsmash

View GitHub Profile
@amazingsmash
amazingsmash / draw_weighted_graph.py
Last active September 12, 2020 20:38
Draw a networkx graph with weighted edges.
import networkx as nx
import matplotlib.pyplot as plt
def draw_weighted_graph(G, pos=None,
node_size=200,
edge_width=3,
font_size=12,
node_color='red',
color_map='Blues'):
"""Draw a networkx graph with weighted edges"""
@amazingsmash
amazingsmash / gist:e9925cc4497bea8af7326b2a4d4a7f8e
Created July 15, 2018 12:18
Little Git cheat that saves me A LOT of time. Use with caution. Usage: 'git cmp "Commit message"'
git config --global alias.cmp '!f() { git status &&
read -p "Are you sure? " -n 1 -r &&
if [[ $REPLY =~ ^[Yy]$ ]]
then
git add -A && git commit -m "$@" && git push
fi; }; f'
@amazingsmash
amazingsmash / gist:560b9b77c7109b35a4569ffaa23da5cb
Created July 15, 2018 12:18
Little Git cheat that saves me A LOT of time. Use with caution. Usage: 'git cmp "Commit message"'
git config --global alias.cmp '!f() { git status &&
read -p "Are you sure? " -n 1 -r &&
if [[ $REPLY =~ ^[Yy]$ ]]
then
git add -A && git commit -m "$@" && git push
fi; }; f'