Skip to content

Instantly share code, notes, and snippets.

View m0rphed's full-sized avatar

Victor Khovanov m0rphed

  • 00:30 (UTC +03:00)
View GitHub Profile
@m0rphed
m0rphed / docker-compose.yml
Created July 17, 2024 22:58
docker-compose wp example
version: '3.7'
volumes:
wp-data:
networks:
wp-back:
services:
db:
@m0rphed
m0rphed / suai-sem-03-prog-QandA.md
Created January 10, 2024 05:20
Основы программирования

Основы программирования

1. Конкурентность в C++ (Cuncurrency in C++).


Конкурентность в C++ относится к способности программы выполнять несколько задач параллельно для улучшения производительности. В C++ существует несколько способов реализации конкурентности, включая использование потоков, мьютексов, futures и execution policies.

  1. Потоки (Threads): Потоки в C++ (стандарт C++11 и выше) позволяют параллельное выполнение различных задач. Пример:

Make a developer-ready Win11 from ashes (user's folder named in CP-1251 😵)

(⚠️ UNSAFE) Renaming the user home folder

Method 1: fast

  • Sign in to "broken" user account && back-up valuable data
  • Open cmd (Run as administrator)
  • net user administrator /active:yes - activate administrator account
  • Sign out from "broken" user account
from typing import Callable, Awaitable, Coroutine
async def async_function() -> int:
return 42
def sync_function() -> str:
return "Hello, world!"
@m0rphed
m0rphed / app.py
Created April 10, 2022 03:17
Fwd from Twitter to Telegram bot v 0.1.0 (deps: twint, aiogram, nest_asyncio)
import asyncio
import twint
from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
import nest_asyncio
nest_asyncio.apply()
TOKEN = 'YOUR_TOKEN_HERE'
bot = Bot(token=TOKEN)
@m0rphed
m0rphed / test.ipynb
Created March 24, 2022 13:56
Test: evcxr (rust in jupyter) assigning array slice to variable with confusing message
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@m0rphed
m0rphed / SQLite_tools.py
Created February 15, 2022 18:58
Программа для расчёта необходимого количества дошиков
# SQLite tools for python by AndrVLDZ (edited by m0rphed)
import sqlite3
from dataclasses import dataclass
from typing import Union
@dataclass(frozen=True)
class SQLiteColumn:
name: str
data_type: str
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, lib, pkgs, ... }:
let
unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in {
imports =
[ # Include the results of the hardware scan.
@m0rphed
m0rphed / сhroot-into-arch-from-liveusb.md
Last active January 22, 2022 13:11
Chroot into arch linux from live-usb

Chroot into arch linux from live-usb

План:

  • берём загрузочную флешку и далее грузимся с неё
  • смотрим на диски
  • понимаем какой раздел какой
  • монтируем сам раздел
  • монтируем подраздел /boot
  • выполняем arch-chroot
@m0rphed
m0rphed / all-in-one.fsx
Last active November 25, 2021 18:22
FParsec dilemma
#r "nuget: FParsec"
open System.Numerics
module AST =
type Name = string
type Expr =
| VarCall of Name
| Literal of PrimitiveT // Unit, Bool, Int, ...
| Lambda of string * Expr