This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Query original: | |
SELECT | |
u.user_id,u.username,u.email, COALESCE(SUM(o.total_amount), 0) AS total_ spent, COUNT(DISTINCT o. order_id) AS total_orders, | |
ROUND (AVG(o. total_amount, 2) AS avg_order_value, | |
MAXo. total amount) AS max order_value, | |
RANK() OVER (ORDER BY SUM(o. total_amount) DESC) AS spending_rank, | |
SELECT MAX(02. order_date) | |
FROM orders 02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Prompt the user for a link | |
echo "Please enter the link to scan:" | |
read link | |
# Output the entered link | |
echo "You entered: $link" | |
curl -s "https://crt.sh/?q=%25.$link&output=json" | jq -r '.[].name_value' | sed 's/\*\.//g' | sort -u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openai import OpenAI | |
import requests | |
from dotenv import load_dotenv | |
import time | |
import os | |
import json | |
load_dotenv() | |
client = OpenAI() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install openai | |
# para probarlo, me bajo el libro Moby Dick, lo divido en 72 secciones y envio cada seccion gpt-4. | |
# Hay que tener cuidado con los parametros MAX_TOKENS_PER_CHUNK y SUMMARY_TOKEN_LIMIT para no molestar a openAI. | |
from openai import OpenAI | |
import requests | |
from dotenv import load_dotenv | |
load_dotenv() | |
client = OpenAI() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ListaDobleEnlazada<T> { | |
private Nodo<T> cabeza; | |
private Nodo<T> cola; | |
// Clase interna Nodo | |
private static class Nodo<T> { | |
T dato; | |
Nodo<T> siguiente; | |
Nodo<T> anterior; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rembg import remove | |
from PIL import Image | |
## Path for input and output image | |
input_img = 'spiderman_with_bg.jpeg' | |
output_img = 'spiderman_without_bg.png' | |
## loading and removing background | |
inp = Image.open(input_img) | |
output = remove(inp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyPDF2 | |
import subprocess | |
# Open the PDF file (Enter Path To Your PDF) | |
file = open('fullnotes_lagrangiano_modelo_estandar.pdf', 'rb') | |
readpdf = PyPDF2.PdfReader(file) | |
# Iterate over each page in the PDF | |
for pagenumber in range(len(readpdf.pages)): | |
# Extract text from the page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webbrowser | |
with open('links.txt') as file: | |
links = file.readlines() | |
for link in links: | |
link = link.strip() # Remove any whitespace or newline characters | |
print(link) | |
webbrowser.open(link) # Use the actual link, not the string 'link' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from faker import Faker | |
import random | |
fake = Faker() | |
def generate_fake_data(num_entries=10): | |
data = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
def analyze_code(directory): | |
# List Python files in the directory | |
python_files = [file for file in os.listdir(directory) if file.endswith('.py')] | |
if not python_files: | |
print("No Python files found in the specified directory.") | |
return |
NewerOlder