docker save -o playwright_image.tar mcr.microsoft.com/playwright/python:v1.49.0-noble-amd64
docker load -i playwright_image.tar
docker pull mcr.microsoft.com/playwright/python:v1.49.0-noble-amd64
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
def non_repeating(data): | |
count = {} | |
# First pass: Count occurrences | |
for char in data: | |
count[char] = count.get(char, 0) + 1 | |
# Second pass: Find the first non-repeating character | |
for char in data: | |
if count[char] == 1: |
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
def shown(data): | |
sb = 73 | |
sp = [data[i : i + sb] for i in range(0, len(data), sb)] | |
print(' = (\n "{}"\n)'.format('"\n "'.join(sp))) |
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
self.app.logger.warning(f"\n\nuser: {user}\n\n") | |
application.logger.warning(f"\n\nuser: {user}\n\n") | |
flask db init | |
flask db migrate -m "models creation" | |
flask db upgrade |
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
# important libraries | |
from flower.utils import strtobool | |
from pip._internal.utils.misc import strtobool | |
from setuptools._distutils.util import strtobool |
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
command: tail -f /dev/null | |
command: sleep indinity | |
# logs location | |
docker inspect --format='{{.LogPath}}' container-id |
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 Xlib.display | |
RED_COLOUR = (0, 0, 255) | |
THICKNESS = 2 | |
def get_mouse_position(): | |
pd = Xlib.display.Display().screen().root.query_pointer()._data | |
return pd["root_x"], pd["root_y"] | |
if MOUSE: |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
"""nginx config file formatter/beautifier with no additional dependencies. | |
Originally published under https://github.com/1connect/nginx-config-formatter, | |
then moved to https://github.com/slomkowski/nginx-config-formatter. | |
""" | |
import argparse |
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 | |
# sudo apt install -y pandoc texlive-latex-base texlive-xetex | |
# Script: md_to_pdf.sh | |
# Description: Convert Markdown files to PDF using pandoc. | |
# Function to display usage | |
usage() { | |
echo "Usage: $0 [-o output_directory] file1.md [file2.md ...]" | |
exit 1 |
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 | |
echo "- lazydocker installation" | |
LAZYDOCKER_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazydocker/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+') | |
curl -Lo lazydocker.tar.gz "https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${LAZYDOCKER_VERSION}_Linux_x86_64.tar.gz" | |
tar -xvzf lazydocker.tar.gz> /dev/null 2>&1 && rm lazydocker.tar.gz | |
mv lazydocker /usr/local/bin/lazydocker && chmod a+x /usr/local/bin/lazydocker | |
echo "+ lazydocker installation" |
NewerOlder