Skip to content

Instantly share code, notes, and snippets.

@barseghyanartur
barseghyanartur / platform_generate.py
Created December 12, 2023 13:27 — forked from cheind/platform_generate.py
cross platform pip-compile helper
import argparse
import platform
import sys
import subprocess
from pathlib import Path
def describe() -> dict:
meta = {
"python": "py" + ".".join(platform.python_version_tuple()[:2]),
@barseghyanartur
barseghyanartur / caddy.rst
Last active November 13, 2023 09:06
Caddy proxy

Caddy

Installation

sudo snap install caddy --edge
@barseghyanartur
barseghyanartur / create_pdf.py
Last active June 22, 2023 07:47
Create a PDF with 500 pages using `faker-file`
from faker import Faker
from faker_file.base import DynamicTemplate
from faker_file.providers.pdf_file import PdfFileProvider
from faker_file.providers.pdf_file.generators import reportlab_generator
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.platypus import PageBreak, Paragraph
FAKER = Faker()
@barseghyanartur
barseghyanartur / rock_paper_scissors.py
Created February 22, 2023 07:54
Rock, paper, scissors game in Python
"""
Usage:
python rock_paper_scissors.py
"""
import random
__title__ = "rock_paper_scissors"
__version__ = "0.1"
@barseghyanartur
barseghyanartur / install_vera_font_on_linux.md
Last active February 16, 2023 08:06
Install Vera font on Linux
@barseghyanartur
barseghyanartur / project_structure_in_rust.md
Created February 15, 2023 09:48
Project structure in Rust

Project structure in Rust

Tree

├── Cargo.toml
└── src
    ├── lib.rs
    ├── main.rs
    └── traits.rs
@barseghyanartur
barseghyanartur / how_to_debug_python_applications.md
Last active February 16, 2023 10:27
How to debug Python applications

How to debug Python applications

rp-L4mz-N2-ZJ0-Pnopju2da-1-kguub.jpg

Introduction

In software development, testing is an essential part of ensuring that code works as intended. One critical aspect of testing is debugging, which involves finding and fixing errors or bugs in a program. In this article, we'll explore how to debug Python applications and highlight some of the most commonly used methods for debugging Python code.

Debugging options

@barseghyanartur
barseghyanartur / how to write a valentine's day message in rust.md
Last active July 29, 2023 20:12
How to write a Valentine's Day message using Stable Diffusion and Rust

How to write a Valentine's Day message using Stable Diffusion and Rust

A practical guide

Step 1

Use your favorite search engine to search for "stable diffusion image generator". You will find a lot of services. Pick one, for example Night Cafe Creator.

Step 2

@barseghyanartur
barseghyanartur / print_function_name_in_rust.md
Created February 13, 2023 11:32
Print function name in Rust

Print function name in Rust

Deps

[dependencies]
function_name = "0.3.0"

Code

@barseghyanartur
barseghyanartur / random_boolean_in_rust.md
Created February 6, 2023 11:36
Rust random boolean

Random boolean in Rust

Prerequisites

[dependencies]
rand = "0.8.5"

Usage example