-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
29 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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}" |
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
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.
fcf6e27
There was a problem hiding this comment.
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