Skip to content

Instantly share code, notes, and snippets.

View Armen-Jean-Andreasian's full-sized avatar
👨‍💻
Inventing something special

Armen-Jean Andreasian Armen-Jean-Andreasian

👨‍💻
Inventing something special
  • Hanoi, Vietnam
View GitHub Profile
@Armen-Jean-Andreasian
Armen-Jean-Andreasian / README.md
Created May 5, 2025 16:45
Embeded video player for README.md for GitHub repositories
  1. For this you need to use S3.
  2. Upload your video to S3
  3. Source your video to markdown file usin the syntax: <https://some-user-asset.s3.amazonaws.com/id/video.mp4>

Works

  • ✅ S3 (GitHub's specific S3 bucket) provides both the video and the embeddable behavior on GitHub.

  • ✅ Works:

@Armen-Jean-Andreasian
Armen-Jean-Andreasian / .dockerignore
Created February 22, 2025 03:28
Generic .dockerignore file for Python projects (extended version)
# Git and version control
.git
.gitignore
# IDE and editor settings
.idea/
.vscode/
*.swp
*.swo
{
"name": "main",
"protection": {
"enabled": true,
"required_status_checks": null,
"enforce_admins": true,
"required_pull_request_reviews": {
"dismiss_stale_reviews": true,
"require_code_owner_reviews": true,
"required_approving_review_count": 1

All

21    : FTP (File Transfer Protocol)
22    : SSH (Secure Shell)
23    : Telnet (Protocol)
25    : SMTP (Simple Mail Transfer Protocol)
53    : DNS (Domain Name System)
80    : HTTP (Hypertext Transfer Protocol)
110   : POP3 (Post Office Protocol)
git config --global gpg.program "C:\Program Files\Git\usr\bin\gpg.exe"
from typing import Callable
class B:
def b(self):
...
@property
def bb(self) -> Callable:
return self.b
@Armen-Jean-Andreasian
Armen-Jean-Andreasian / main.py
Created April 23, 2024 08:14
Library Problem [Non-ordinary Solution]
class Book:
def __init__(self, title, genre):
self.title = title
self.genre = genre
class LibraryShelves(dict):
def add_shelf(self, new_genre: str):
"""Adds a new shelf to library"""
if new_genre not in self:

Metaclasses

The metaclasses are responsible for the instantiation process.

  • By default, the metaclass of any Python class is type. same as class MyClass(metaclass=type)

Whenever, you do my_class = MyClass():

  1. MyClass.__call__() method is being called. This happens because in Python, calling an instance as a function, calls the __call__() method of the class.
  2. Inside the MyClass.__call__() method of the class:
    1. The MyClass.__new__() method is being called to create a new instance.
    2. MyClass.__new__() is a stub method calling the parent's .__new__(), in this case type.__new__()).
@Armen-Jean-Andreasian
Armen-Jean-Andreasian / readme.txt
Created February 13, 2024 15:10
Installing Kali Linux on Windows
1. Open the cmd. Press Win+R. Then type cmd and press enter.
2. In cmd, type the command:
wsl --install --distribution kali-linux
P.S. To find the app press Win key and type Kali Linux
Fonte: https://www.maccanismi.it/2012/08/21/elenco-url-streaming-radio-italiane-sul-web-rtl-rds-radio-kiss-kiss-r101-virgin-radio-e-moltre-altre/
Da usare per lettori come VLC e similari.
RTL:
http://shoutcast.rtl.it:3010/
RTL Best:
http://shoutcast.rtl.it:3020/
RTL ItalianStyle: