Skip to content

Instantly share code, notes, and snippets.

View maintainer64's full-sized avatar
🎯
Focusing

Maintainer P maintainer64

🎯
Focusing
View GitHub Profile
// AVG BUFF
type AvgBuffColor struct {
_currentIndex int
_colors []color.RGBA
}
func NewAvgBuffColor(bufferSize uint) *AvgBuffColor {
return &AvgBuffColor{
_currentIndex: -1,
# Content /opt/libs/all.yaml
include:
- 'execute_telnet.yaml'
- 'scripts_get_ip.yaml'
- 'scripts_ping_ip.yaml'
# Content /opt/libs/scripts_get_ip.yaml
include:
- 'execute_telnet.yaml'
@maintainer64
maintainer64 / uml_converter.py
Created July 27, 2023 20:21
uml-code, uml-export, uml_converter.py, converter markdown PlantUML extentions to png images
import string
import requests
import zlib
import base64
import pathlib
maketrans = bytes.maketrans
BEFORE = "scale 4000 width"
@maintainer64
maintainer64 / simple_export_json_from_notion_sync.py
Created February 21, 2023 18:21
Export json from notion by API
import requests
TOKEN_NOTION = "..."
uuid = "..."
def get_database_by_id(
database_id: str,
page_size: int = 1000
@maintainer64
maintainer64 / simple_export_dataframe_from_google_sheets_sync.py
Created February 21, 2023 16:58
Export dataframe pandas object from Google Sheets by link to view
import requests
import pandas as pd
from io import BytesIO
# https://docs.google.com/spreadsheets/d/1fzRAc7J38i2xLgq3dzJIgnNtcmM3JYbCI7LlmkvIfcc/edit
# |----Идентификатор-книги-(spreadsheet_id)----|
def google_sheet_export_dataframe(
spreadsheet_id: str,
sheet_name: str
@maintainer64
maintainer64 / simple_sender_text_to_notion.php
Created February 19, 2023 07:57
Простая отправка данных в ноушен форму и валидация Email
<?php
$value = $_POST["text"];
if (filter_var($value, FILTER_VALIDATE_EMAIL)) {
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://notionforms.io/api/forms/emailsvr/answer',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
@maintainer64
maintainer64 / simple_export_dataframe_from_google_sheets.py
Created February 19, 2023 03:48
Export dataframe pandas object from Google Sheets by link to view
from io import BytesIO
import pandas as pd
from aiohttp import ClientSession
from asyncio import run
# https://docs.google.com/spreadsheets/d/1fzRAc7J38i2xLgq3dzJIgnNtcmM3JYbCI7LlmkvIfcc/edit
# |----Идентификатор-книги-(spreadsheet_id)----|
async def google_sheet_export_dataframe(
spreadsheet_id: str,
"""
Для решения данной задачи необходимо на листе бумаги построить математическу модель, которая приведёт к результату.
Самое главное в этой задаче не меня ширину и высоту поля, поскольку **комбайн** не может повернуть поле
"""
def harvester_math(n:int, m:int) -> int:
if n <= m:
# n - small
return 2*(n - 1)
else:
# m - small
"""
Maximum number from array
Task number of 78 Unilecs (https://vk.com/unilecs)
This function solve task from https://vk.com/@unilecs-task-77-proveryaem-chislo-na-prostotu-bez-ciklov
"""
def function(array: list):
def biggest(a:int, b:int):
a = str(a)
b = str(b)
def sequence_string(e, arr):
"""
This function solve task from https://vk.com/@unilecs-anons-44-posledovatelnost by the string method
:param e: string, len which = 1
:param arr: list of string, len which = 1
:return: bool
"""
# Кол-во символов e
n: int = 5
# e * n -> Строка символов `e` из `n` элементов