Category: Code
-
How to merge specific file changes from branch B into branch A without merging the entire branch
Use this git command to fetch changes from specific file instead of merging the whole branch! git checkout B — path/to/your/file
-
How to get rid of SQLAlchemy deprecated API while TDD with pytest
Deprecated API features detected! These feature(s) are not compatible with SQLAlchemy 2.0. To prevent incompatible upgrades prior to updating applications, ensure requirements files are pinned to “sqlalchemy<2.0”. Set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings. Set environment variable export SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
-
How to stream media file from s3 directly to AWS lambda FFMPEG Python example
There is no need to download a file and put it inside your lambda’s /tmp folder to process it with FFMPEG. I will show you how to do it “on the fly”. Just stream a damn file directly into ffmpeg! def execute_ffmpeg_command(input_file: str): “”” Execute the given ffmpeg command against the input file. Args: input_file…
-
How to measure execution time of a function in Python, with example
this would be the timeit decorator: from functools import wraps import time def timeit(func): @wraps(func) def timeit_wrapper(*args, **kwargs): start_time = time.perf_counter() result = func(*args, **kwargs) end_time = time.perf_counter() total_time = end_time – start_time print(f’Function {func.__name__}{args} {kwargs} Took {total_time:.4f} seconds’) return result return timeit_wrapper example how this decorator works: @timeit def lol(): print(“lmao, Serhii is the…
-
Release: @responseWithQrBot – QR Code Generator (Telegram bot)
Introducing My QR Code Generator Bot Hello, everyone! Today, I’m excited to introduce you to a bot I created: the QR Code Generator Bot. This bot allows you to generate QR codes easily through Telegram. Whether you need to share a link, a message, or any other information, this bot can quickly create a QR…
-
released telegram to wordpress manual posting script
please visit and rate my work at https://github.com/webprice/post-from-telegram-to-wordpress script is free for usage, you can pass your sensitive information into .env file and deploy files to whatever server you want and it would work.
-
AWS: botocore.exceptions.NoRegionError: You must specify a region.
solution: export AWS_DEFAULT_REGION=us-west-2
-
Get rid of screen flickering in Ubuntu 22.04
In file /etc/default/grub: add to parameter GRUB_CMDLINE_LINUX_DEFAULT: i915.enable_dc=0 intel_idle.max_cstate=2