Skip to content

Instantly share code, notes, and snippets.

View rodion-m's full-sized avatar

Rodion Mostovoi rodion-m

  • Almaty
  • 10:20 (UTC +05:00)
View GitHub Profile
@rodion-m
rodion-m / youtrack_issues_importer.py
Created October 10, 2024 04:25
YoutTack to SQLite issues importer 2024
import argparse
import json
import logging
import os
import sqlite3
import requests
from tqdm import tqdm
# --- Configuration ---
@rodion-m
rodion-m / codealive_draft.md
Last active October 4, 2024 05:41
codealive_draft.md

CodeAlive Logo

AI that understands your entire codebase

Streamline your development process and boost team productivity with CodeAlive:

  • Instant Answers: Get accurate responses to your codebase questions in natural language
  • Context-Aware Code Reviews: Elevate your Pull/Merge Requests with AI that understands your entire system
  • Tickets Enrichment: an AI-expert that writes suggestions and dev notes to help developers to get started
@rodion-m
rodion-m / SymbolDisplayFormatFactory.cs
Created July 13, 2024 21:42
A factory for creating instances of the internal SymbolDisplayFormat class from the Roslyn library.
using System.Reflection;
using Microsoft.CodeAnalysis;
namespace Gend.Domain;
/// <summary>
/// Provides a factory for creating instances of the internal SymbolDisplayFormat class from the Roslyn library.
/// </summary>
public static class SymbolDisplayFormatFactory
{
@rodion-m
rodion-m / AudioChunksSplitter.py
Last active May 11, 2024 18:48
Smart audio splitter for Whisper
import logging
import os
import sys
import time
from typing import List
from pydub import AudioSegment
from pydub.silence import split_on_silence
MAX_CHUNK_SIZE_MB = int(os.getenv("MAX_CHUNK_SIZE_MB", 100))
@rodion-m
rodion-m / meta-expert-prompt.txt
Created February 21, 2024 11:52
Царь-промпт Meta-Expert
You are Meta-Expert, an extremely clever expert with the unique ability to collaborate with multiple experts (such as Expert Problem Solver, Expert Mathematician, Expert Essayist, etc.) to tackle any task and solve any complex problems. Some experts are adept at generating solutions, while others excel in verifying answers and providing valuable feedback.
Note that you also have special access to Expert Python, which has the unique ability to generate and execute Python code given natural-language instructions. Expert Python is highly capable of crafting code to perform complex calculations when given clear and precise directions. You might therefore want to use it especially for computational tasks.
As Meta-Expert, your role is to oversee the communication between the experts, effectively using their skills to answer a given question while applying your own critical thinking and verification abilities.
To communicate with an expert, type its name (e.g., "Expert Linguist" or "Expert Puzzle Solver"), follow
@rodion-m
rodion-m / mentorship_reviews.md
Last active April 19, 2024 17:48
Отзывы о моей работе

Обо мне

Привет! Рад видеть вас на своей странице. Сначала ключевое обо мне:

Меня зовут Родион Мостовой. Более 10-ти лет я программирую за деньги под платформу .NET, из них 6 лет на ASP.NET Core. Почти 3 года преподаю C# и ASP.NET Core, за это время научился объяснять сложные концепции простым языком, разработал несколько собственных учебных курсов. Сейчас преподаю в OTUS. В обучении предпочитаю, прежде всего, подход через общение, наводящие вопросы и разбор практических кейсов.

Веду несколько популярных Open Source проектов на GitHub: https://github.com/rodion-m/

С чем могу помочь

С понимаем самых сложных тем:

  • Асинхронность/многопоточность (async/await, ThreadPool и т. д.)

Давайте рассмотрим пример использования контекста и хуков в React для работы с API клиентом. В этом примере мы создадим контекст для API клиента, который будет доступен во всем приложении.

  1. Создание Context для API клиента: Сначала мы создадим ApiClientContext, который будет хранить наш API клиент.
import React, { createContext } from 'react';

// Создаем контекст
export const ApiClientContext = createContext();
@rodion-m
rodion-m / GitService.cs
Last active October 26, 2023 14:48
Задача о блокирующих методах и пропускной способности в ASP.NET Core
public class GitService
{
// Вася не может взять в толк, как сделать так, чтобы этот метод не тормозил все веб-приложение на ASP.NET Core.
public string ReadGitFile(string repoUri, string fileName)
{
using var repo = new Repository(repoUri); //from LibGit2Sharp
var readmeBlob = (Blob) repo.Head[fileName].Target;
return readmeBlob.GetContentText();
}
}
@rodion-m
rodion-m / Channels_example.cs
Created May 2, 2023 16:11
Example of using Channels instead of lock (by ChatGPT)
using System;
using System.Threading.Channels;
using System.Threading.Tasks;
class Example
{
static async Task Main(string[] args)
{
var channel = Channel.CreateUnbounded<string>();
var producerTask = ProduceMessagesAsync(channel.Writer);
@rodion-m
rodion-m / Phone.cs
Last active March 13, 2023 17:12
Value object phone example
using System;
using System.Text.RegularExpressions;
using Microsoft.EntityFrameworkCore;
namespace SimpleJournal.ValueObjects;
[Owned]
public class Phone
{
public string Value { get; private set; }