This file contains hidden or 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 android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.compose.animation.animateColorAsState | |
| import androidx.compose.animation.core.tween | |
| import androidx.compose.foundation.layout.Arrangement | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.Row | |
| import androidx.compose.foundation.layout.Spacer |
This file contains hidden or 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
| # Maintainer: Jakub Hajek, jakub.hajek@cometari.com | |
| # | |
| # docker stack deploy -c stack-elastic.yml elastic | |
| # | |
| # The stack creates Elasticsearch cluster consiting of | |
| # - 3 dedicated master nodes in order to keep quorum | |
| # - 4 dedicated data nodes to manage CRUD, | |
| # | |
| # Docker compose file to easily deploy Elasticsearch cluster 7.x on Docker Swarm cluster. |
This file contains hidden or 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
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
This file contains hidden or 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
| # This is Python port of this Javascript method: | |
| # https://github.com/notslang/instagram-id-to-url-segment/blob/master/lib/index.coffee | |
| url = "https://www.instagram.com/p/B8iwlG9pXHI/" | |
| # ----> use regexp to extract code from url | |
| code = "B8iwlG9pXHI" | |
| charmap = { | |
| 'A': '0', | |
| 'B': '1', |
This file contains hidden or 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
| # Created by .ignore support plugin (hsz.mobi) | |
| ### Python template | |
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] | |
| *$py.class | |
| # C extensions | |
| *.so |
This file contains hidden or 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
| # pip install python-barcode | |
| # pip install "python-barcode[images]" | |
| from io import BytesIO | |
| from barcode import EAN13 | |
| from barcode.writer import ImageWriter | |
| # Write to a file-like object: | |
| rv = BytesIO() |
This file contains hidden or 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
| # pip install pymupdf | |
| import os | |
| import fitz # PyMuPDF | |
| def pdf_to_images(pdf_path, output_folder, zoom=1.0): | |
| """ | |
| Convert PDF pages to images with a zoom scale. |
This file contains hidden or 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
| # pip install python-whois | |
| import whois | |
| def get_domain_info(domain): | |
| try: | |
| # Query the domain information | |
| domain = whois.whois(domain) | |
| print(domain) | |
| # print(f"Domain Name: {domain.domain_name}") |
This file contains hidden or 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
| services: | |
| db: | |
| image: postgres:17.2-bookworm | |
| environment: | |
| - POSTGRES_USER=postgres | |
| - POSTGRES_PASSWORD=postgres | |
| - POSTGRES_DB=postgres | |
| ports: | |
| - "5433:5432" | |
| restart: always |
This file contains hidden or 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
| # Use one in these way: | |
| * ssh-keygen -t ed25519 -C "your_email@example.com" | |
| If you are using a legacy system that doesn't support the Ed25519 algorithm, use: | |
| * ssh-keygen -t rsa -b 4096 -C "your_email@example.com" | |
OlderNewer