Skip to content

Instantly share code, notes, and snippets.

View whyme0's full-sized avatar
:electron:
∞ To infinity and beyond

George whyme0

:electron:
∞ To infinity and beyond
View GitHub Profile
@whyme0
whyme0 / img2pdf.py
Created September 2, 2025 19:10
Convert all images in directory same as running script to single pdf
import os
from PIL import Image
def images_to_pdf(folder, output_pdf):
exts = (".jpg", ".jpeg", ".png", ".bmp", ".tiff")
files = [f for f in os.listdir(folder) if f.lower().endswith(exts)]
files.sort()
if not files:
print("No images in directory")
return
@whyme0
whyme0 / command.txt
Created August 6, 2025 15:21
This command start rabbitmq service using docker. It will be available to use on http://localhost:15672
docker run -d --hostname rmq_test --name test -p 15672:15672 rabbitmq:management
p.s. stop and remove CONTAINER: "docker stop test; docker rm test"
@whyme0
whyme0 / Prompt.md
Created February 15, 2025 13:03
ChatGPT prompt to act like prompt-enhancer in russian

Ты — эксперт в области оптимизации промптов для ИИ-моделей, способный анализировать, исправлять и совершенствовать запросы, делая их максимально понятными и эффективными.

Твоя задача:

  1. Принять мой исходный промпт.
  2. Выявить его ошибки, недочёты и потенциальные улучшения.
  3. Полностью переписать промпт для максимального качества результата.

Правила улучшения промпта:

  1. Определение цели — чётко сформулируй основную суть запроса, убери лишние слова и сделай задачу конкретной.
@whyme0
whyme0 / Program.cs
Last active August 7, 2025 06:50
Using EnsureCreated/EnsureDeleted for managing database schema WHILE developing ASP application
// NB: Stopping application via Visual Studio's "Stop Debugging" will not cause ApplicationStopping's inner code
// So, ensure to stop application via Ctrl+C in your running console, instead of it "Stop Debugging"
// What to do when applications started
app.Lifetime.ApplicationStarted.Register(() =>
{
using (IServiceScope scope = app.Services.CreateScope())
{
AppDbContext dbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
dbContext.Database.EnsureCreated();
@whyme0
whyme0 / psql-commands.sql
Last active June 20, 2025 13:25
🛠 Usefull Postgres commands
-- Create user:
CREATE USER username WITH PASSWORD 'qwerty12345';
-- Before giving access to specific table the connection should be established to it
GRANT pg_read_all_data TO username;
GRANT pg_write_all_data TO username;
GRANT ALL ON DATABASE db_name TO username;
ALTER DATABSAE db_name OWNER TO username;
-- Change encoding in psql shell
@whyme0
whyme0 / config
Last active December 24, 2022 14:47
🗜 Usefull settings for Firefox Browser (about:config page)
# Settings for turning off Firefox update notification
app.update.badgeWaitTime wait time 785600
app.update.channel never
app.update.checkInstallTime false
app.update.checkInstallTime.days 365
app.update.download.attempts 0
app.update.download.promptMaxAttempts 0
app.update.elevate.attempts 0
app.update.elevation.promptMaxAttempts 0
app.update.interval 86200
@whyme0
whyme0 / mysql-commands.sql
Last active February 12, 2024 15:48
🛠 Usefull MySql commands
// Creates new user with name 'username' and password '123456789'
CREATE USER 'username'@'localhost' IDENTIFIED BY '123456789';
// Give all privileges on database to user
GRANT ALL PRIVILEGES ON `db-name` . * TO 'username'@'localhost';
FLUSH PRIVILEGES;
@whyme0
whyme0 / MyAwesomeProject.csproj
Last active July 27, 2022 18:51
🗜 Short snippet of how you can add MySql provider to your ASP.NET project
<!-- Some bored csproj's stuff above... -->
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="..." />
<!-- Some bored csproj's stuff above... -->