Skip to content

Instantly share code, notes, and snippets.

View jjesusfilho's full-sized avatar
🏠
Working from home

José de Jesus Filho jjesusfilho

🏠
Working from home
View GitHub Profile
@jjesusfilho
jjesusfilho / Oscar_bot.py
Created November 24, 2023 16:30 — forked from janakiramm/Oscar_bot.py
Implementing RAG with OpenAI
import openai
import tiktoken
from scipy import spatial
import pandas as pd
df=pd.read_csv('./data/oscars.csv')
print(df.head())
df=df.loc[df['year_ceremony'] == 2023]
df=df.dropna(subset=['film'])
@jjesusfilho
jjesusfilho / python-zeep-example.md
Created August 20, 2023 23:02 — forked from FilBot3/python-zeep-example.md
Python Zeep SOAP Example Write Up

Python Zeep SOAP Client

First, we'll look at the SOAP URL and see what Prefixes, Global Elements, Global Types, Bindings, and Services are provided by the SOAP Service.

You can do this by running zeep as a CLI tool.

export WSDL_URL="http://www.dneonline.com/calculator.asmx?WSDL"
python -m zeep $WSDL_URL
@jjesusfilho
jjesusfilho / tipos-de-logradouros.md
Created January 13, 2022 22:21 — forked from tassoevan/tipos-de-logradouros.md
Tipos de logradouro do Brasil.
  • Aeroporto
  • Alameda
  • Área
  • Avenida
  • Campo
  • Chácara
  • Colônia
  • Condomínio
  • Conjunto
  • Distrito
@jjesusfilho
jjesusfilho / postgres-cheatsheet.md
Created April 2, 2021 20:18 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@jjesusfilho
jjesusfilho / matmul.sql
Created September 10, 2020 01:46 — forked from acarl005/matmul.sql
Matrix multiplication using a Postgres Table
DROP TABLE IF EXISTS matrices;
CREATE TABLE matrices (
matrix_id int NOT NULL, -- unique identifier for each matrix
i int NOT NULL, -- row number
j int NOT NULL, -- column number
val decimal NOT NULL, -- the value in this cell
PRIMARY KEY (matrix_id, i, j)
);
-- insert sparse representation of
@jjesusfilho
jjesusfilho / postgres_queries_and_commands.sql
Created July 6, 2019 09:26 — forked from rgreenjr/postgres_queries_and_commands.sql
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%'
@jjesusfilho
jjesusfilho / 00. tutorial.md
Created May 19, 2019 02:53 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@jjesusfilho
jjesusfilho / app.R
Last active April 21, 2019 09:53 — forked from senthilthyagarajan/app.R
módulo datatable editável
### Libraries
library(shiny)
library(dplyr)
library(DT)
### Data
input_data <- data.frame(Brand = c("Brand1", "Brand2","Brand3"),
ratio = c (.5, .5, .5),
cost = c(2000, 3000, 4000),
stringsAsFactors = FALSE) %>%
@jjesusfilho
jjesusfilho / diversos.sh
Last active May 22, 2019 16:57 — forked from keithmorris/drive-format-ubuntu.md
my ubuntu scripts
## Versão do ubuntu
`lsb_release -a`
@jjesusfilho
jjesusfilho / app.R
Created September 6, 2018 16:01 — forked from jcheng5/app.R
Using OAuth2 with Shiny
library(shiny)
# WARNING: This sketch does not make proper use of the "state" parameter.
# Doing so usually involves using cookies, which can be done with the
# Rook package but I have not done that here. If you choose to use this
# approach in production, please check the state parameter properly!
APP_URL <- if (interactive()) {
# This might be useful for local development. If not, just hardcode APP_URL
# to the deployed URL that you'll provide a few lines below.