Skip to content

Instantly share code, notes, and snippets.

@LoboLofi
LoboLofi / GraphFunction.py
Created October 1, 2019 05:00
A snipet to plot whatever function in R2 that depends of some constant A. Have a three examples, have a lot of issues.
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.legend_handler import HandlerLine2D
import matplotlib.pyplot as plt
import math
def drange(start, stop, step):
r = start
while r < stop:
yield r
r += step
@LoboLofi
LoboLofi / DoOracleSQL.py
Created September 5, 2019 21:40
Get a connection and execute a SQL in Oracle with python.
import cx_Oracle
import os
# Data Base configuration
db_host = os.environ.get('DB_HOST')
db_port = os.environ.get('DB_PORT')
db_name = os.environ.get('DB_NAME')
db_user = os.environ.get('DB_USER')
db_pass = os.environ.get('DB_PASS')
@LoboLofi
LoboLofi / tmeasure.py
Created July 27, 2019 01:20
Measure time and then show some metrics. The Non-Build-Profiler-hard-way
import time
import functools
class tmeasure(object):
dicTimes = {}
initTime = 0
glbTime = 0
def __init__(self):
initTime = 0
from bs4 import BeautifulSoup
import requests
import re
import sys
def download( fileUri, filename ):
'''
Function to download files with http get.
The limit size is around 10Mb
'''