Skip to content

Instantly share code, notes, and snippets.

View dantetemplar's full-sized avatar

Ruslan Bel'kov dantetemplar

View GitHub Profile
@dantetemplar
dantetemplar / TASK.md
Created November 20, 2025 08:25
OrcaSlicer slice via API

Project: OrcaSlicer HTTP API Wrapper

Contact: https://t.me/dantetemplar

Background

We need a way to slice 3D models programmatically from a Python backend, without any manual GUI interaction. Initially this was attempted with CuraEngine, but in practice it turned out to be hard to configure, debug, and run reliably in a headless environment.

OrcaSlicer, on the other hand, provides a modern slicing pipeline, good default profiles, and an active community. However, it is primarily a desktop GUI tool. The goal of this project is to wrap OrcaSlicer into a small, well-documented HTTP service that can be called from other systems, especially Python-based backends.

@dantetemplar
dantetemplar / index.js
Last active November 19, 2025 19:21
Sort Aliexpress items by total price: price + shipping
void (async () => {
// ---------- helpers ----------
const parseNumber = (text) => {
if (!text) return NaN;
text = text.replace(/\u00a0/g, " ");
const m = text.match(/(\d+[.,\s]?\d*)/);
if (!m) return NaN;
return Number(m[1].replace(",", ".").replace(" ", ""));
};
@dantetemplar
dantetemplar / telegram_authorization.py
Last active February 17, 2025 21:49
Check Telegram WebAppData and LoginWidgetData in Python with FastAPI
"""
Check Telegram WebAppData and LoginWidgetData in Python with FastAPI.
Source: https://gist.github.com/dantetemplar/68e09e3674bf6ce72e23b89b2091d159
License: MIT License
Author: Ruslan Belkov
"""
import hashlib
import hmac
@dantetemplar
dantetemplar / 2.README-GIST.md
Last active March 15, 2024 11:50
Aiogram 3 log messages and handlers

Aiogram 3 log messages and handlers

Warning

Tested on aiogram=3.3.0, code may failed with another version as it uses tricky things

Features

изображение

Automatically log every action from user

Each user action will be displayed in a log stream with the appropriate type (Message, CallbackQuery and so on).

@dantetemplar
dantetemplar / 1.README-GIST.md
Last active December 5, 2024 19:33
Async alembic configuration

Async alembic configuration

Features

Database connection from settings.yaml

You don't need to change alembic.ini to set up a database connection. Alembic will derive database connection uri from settings.yaml (or any yaml which you specify in SETTINGS_PATH environment variable).

Example of settings.yaml: