Skip to content

Instantly share code, notes, and snippets.

View adamori's full-sized avatar
🫠

Adam Alidibirov adamori

🫠
View GitHub Profile
@adamori
adamori / assignment3.md
Created March 7, 2023 14:12
Доказать логическое тождество (формульно) и проверить его с помощью построения таблицы истинности. Уточнение задания. Доказательство истинности можно реализовать программно. Для этого надо написать код, вычисляющий правую и левую части доказываемого тождества, и сравнить полученные результаты. Рекомендуется использовать предварительно написанные…

image

def formula(x, y, z):
    return (x <= (y == z)) == ((x <= y) == (x <= z))

test_cases = [
    (False, False, False), #1
 (False, False, True), #2
import math
def is_simple_number(n):
if n < 2:
return False
elif n == 2:
return True
elif n % 2 == 0:
return False
else:
@adamori
adamori / reactive-vue-axios.md
Created November 12, 2023 14:19
Extension of the Axios library for use with Vue.js. The main purpose is to integrate a loading indicator (using Vue's Ref type) with Axios requests to automatically change state of loading state.

Axios Loading State Reactivity

Extension of the Axios library for use with Vue.js. The main purpose is to integrate a loading indicator (using Vue's Ref type) with Axios requests to automatically change state of loading state.

Check the example project

Steps

  1. Create or insert into existing env.d.ts file located on the same directory with tsconfig.json. If you don't use typescript in your project, skip
@adamori
adamori / hetzner_firewall_manager.py
Last active September 25, 2024 16:01
This Python script manages temporary firewall rules for a Hetzner Cloud server, ideal for use in CI/CD pipelines like GitHub Actions. It allows temporary SSH access from a specific IP address during automated tasks.
import os
import sys
import requests
import logging
import argparse
from typing import Optional
from dotenv import load_dotenv
from dataclasses import dataclass
# Configure root logger
@adamori
adamori / z.sh
Created February 2, 2025 16:12
Setups oh-my-zsh with zsh-autosuggestions and zsh-syntax-highlighting plugins
#!/bin/bash
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Function to log messages
log() {
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1"