Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tg1482 committed Apr 28, 2023
1 parent 312ef11 commit fcf6e27
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 29 deletions.
62 changes: 33 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions scripts/db_data_summary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# load environment variables
source ./.env.local

# MySQL query to fetch data
QUERY="SELECT count(*) FROM UserDimension;"

# execute query using pool object
DATA=$(node -e "const { pool } = require('./lib/db.js'); const { RowDataPacket } = require('mysql2'); async function fetchData() { const rows = await pool.query<RowDataPacket>('${QUERY}'); return rows; }; fetchData().then(console.log).catch(console.error);")

# print data
echo "${DATA}"
22 changes: 22 additions & 0 deletions scripts/optimize_image_resolution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os
from PIL import Image

def compress_image(input_image_path, output_image_path, quality=60):
with Image.open(input_image_path) as img:
img.save(output_image_path, "JPEG", quality=quality)

def optimize_images_in_directory(directory, output_directory):
if not os.path.exists(output_directory):
os.makedirs(output_directory)

for filename in os.listdir(directory):
if filename.lower().endswith(('.jpg', '.jpeg', '.png')):
input_image_path = os.path.join(directory, filename)
output_image_path = os.path.join(output_directory, filename)
compress_image(input_image_path, output_image_path)

if __name__ == "__main__":
input_directory = "../public"
output_directory = "../optimized_public"
optimize_images_in_directory(input_directory, output_directory)
print(f"Images have been optimized and saved in {output_directory}")
Empty file added whisper.log
Empty file.

1 comment on commit fcf6e27

@vercel
Copy link

@vercel vercel bot commented on fcf6e27 Apr 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

huber-gpt – ./

huber-gpt-git-main-tg1482.vercel.app
huber-gpt.vercel.app
huber-gpt-tg1482.vercel.app
www.hubergpt.com

Please sign in to comment.