Skip to content

Instantly share code, notes, and snippets.

View stanlee321's full-sized avatar

Stanley Salvatierra stanlee321

View GitHub Profile
from pyvis.network import Network
g = Network(height="750px",
width="80%", directed=True)
g.toggle_hide_edges_on_drag(True)
size_pos = len(list(dfs["DATOS DEL POSITIVO"]["NOMBRRE_COMPLETO"]))
size_cont = len(list(dfs["DATOS DEL CONTACTO"]["NOMBRRE_COMPLETO"]))
@stanlee321
stanlee321 / firebase_upload_python.py
Last active June 9, 2020 03:55
Firebase upload python
from google.cloud import storage
import os
class FireBaseSync:
def __init__(self, credentials_path = "Mnse-f823ecc07175.json",
bucket_name = "musense.appspot.com"):
# Set credentials
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = credentials_path
@stanlee321
stanlee321 / readme.md
Created June 9, 2020 00:51
nohup python

nohup /path/to/test.py > output.log & nohup python /path/to/test.py > output.log &

You can find the process and its process Id with this command:

ps ax | grep test.py

@stanlee321
stanlee321 / ssh-setup.md
Created June 1, 2020 01:05
SSH_AUTH_GITHUB
git filter-branch --tree-filter 'rm -rf notebooks/fb_comments_emb.idx' -f HEAD

Create pdf from jupyter w/out input

jupyter nbconvert --to pdf  Analisis_Actas_piso22.ipynb --no-input
@stanlee321
stanlee321 / pandas_tricks.py
Last active July 10, 2020 16:10
PANDAS TRICKS
# Split and expand string values into columns
df[‘name’] = df.name.str.split(" ", expand=True)
# GRoup by two columns
gkk = df.groupby(['Team', 'Position'])
# Merge two df with common columns
pipenv install flask gunicorn
pipenv shell