Skip to content

Instantly share code, notes, and snippets.

@rodrigobercini
rodrigobercini / bovespa.py
Last active May 14, 2021 14:07
Como extrair dados do Bovespa de graça com Python
# Instalando e importando yahooquery
from yahooquery import Ticker
# Período máximo
petr = Ticker("PETR4.SA")
petr.history(period='max')
# Datas específicas
petr.history(start='2005-05-01', end='2013-12-31')
@martinsotir
martinsotir / google_ai_notebooks_tips.md
Last active July 8, 2023 13:29
Google AI notebook tips

Google AI Platform Notebook tips

AI Notebooks vs Colab

Google Colab: https://colab.research.google.com/

  • Free compute! and interesting, fixed cost, 10$/month Google Colab Pro version.
  • Notebooks are very easy to share, with ability to control permissions (integration in google drive/doc ecosystem).
  • Instant availability. No requirement other than a regular google account.
  • Idle time limit : 1h in free version.
@bshishov
bshishov / forecasting_metrics.py
Last active January 27, 2025 21:48
Python Numpy functions for most common forecasting metrics
import numpy as np
EPSILON = 1e-10
def _error(actual: np.ndarray, predicted: np.ndarray):
""" Simple error """
return actual - predicted
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active March 10, 2025 01:36
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'