Skip to content

Instantly share code, notes, and snippets.

View dieissonmartins's full-sized avatar
:shipit:
code coffee ♨️

Dieisson Martins dieissonmartins

:shipit:
code coffee ♨️
View GitHub Profile
@dieissonmartins
dieissonmartins / gist:6b3a330c704eeb82ce3351362b598c91
Created April 3, 2024 11:58
Unable to create a new hotfix in SourceTree gitflow
git config --add gitflow.multi-hotfix true
Base: https://dados.gov.br/dados/conjuntos-dados/cadastro-nacional-da-pessoa-juridica---cnpj
Lib: https://github.com/php-webdriver/php-webdriver
Instalação:
mkdir selenium-php-example
cd selenium-php-example
composer require php-webdriver/webdriver
Configuração:
<?php
@dieissonmartins
dieissonmartins / gist:f31b392900ed610737f8ef942916c702
Created October 11, 2023 13:31
Verifica se view de uma tabela já existe
SELECT TABLE_NAME AS ViewName
FROM information_schema.VIEWS
WHERE
TABLE_SCHEMA = 'desenvolvimento'
AND VIEW_DEFINITION LIKE '%tabela_aqui%'
SELECT VIEWS.TABLE_NAME AS view_name,
VIEWS.VIEW_DEFINITION AS view_definition,
TABLES.TABLE_NAME AS source_table
FROM INFORMATION_SCHEMA.VIEWS AS VIEWS
JOIN
INFORMATION_SCHEMA.TABLES AS TABLES
ON
VIEWS.TABLE_NAME = TABLES.TABLE_NAME;
import sqlalchemy
# Create a connection to the sales database
db_engine = sqlalchemy.create_engine("postgresql+psycopg2://repl:password@localhost:5432/sales")
# Query all rows and columns of the sales table
raw_sales_data = pd.read_sql("SELECT * FROM sales", db_engine)
print(raw_sales_data)
import pandas as pd
# your df
# =========================
print(df)
id score1 score2 score3 score4 score5
0 1 0.0000 0.1087 0.0000 0.0786 1
1 2 0.0532 0.3083 0.2864 0.4464 1
2 3 0.0000 0.0840 0.8090 0.2331 1
import boto3
s3_client = boto3.client('s3')
s3_client.download_file(
Bucket='radishlogic-bucket',
Key='s3_folder/photo.jpg',
Filename='local_folder/image.jpg'
)
sudo ip route add 52.200.27.87/32 via 10.8.0.1
sudo ip route add 54.147.153.11/32 via 10.8.0.1
sudo ip route add 54.232.107.223/32 via 10.8.0.1
sudo chmod o+w ./storage/ -R
sudo chmod -R 777 bootstrap/cache/
chmod +x *.sh
ln -s ./public ./html
php artisan cache:clear
route
docker stop $(docker ps -qa)
sudo docker system prune -a