Skip to content

Instantly share code, notes, and snippets.

View amazingsmash's full-sized avatar

José Miguel Santana amazingsmash

View GitHub Profile
# TEST GIST FOR THE SUBJECT HPI (2024)
# MIT License
#
# Copyright (c) 2024 José Miguel Santana Núñez
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
import os
@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'