Skip to content

Instantly share code, notes, and snippets.

View DeoEsor's full-sized avatar
😾

Valeriy Vartumyan DeoEsor

😾
View GitHub Profile
@DeoEsor
DeoEsor / decorator.cpp
Created September 13, 2023 08:55 — forked from lizhongz/decorator.cpp
C++ decorator measuring the execution time of a function
#include <functional>
#include <chrono>
#include <iostream>
template <class> struct ExeTime;
// Execution time decorator
template <class R, class... Args>
struct ExeTime<R(Args ...)> {
public:
@DeoEsor
DeoEsor / SomeShitCode.cs
Created September 1, 2023 20:51
ХУЯК ЕБАК И В ПРОД
float horizontalInput = Input.GetAxis("Horizontal");
float verticalInput = Input.GetAxis("Vertical");
Debug.Log(horizontalInput + " " + verticalInput);
//****************************
// HP MANAGEMENT SEGMENET
if(xp<15) //кто блять HP назвал xp
UIManager.GetInstance().UIDamaged();
@DeoEsor
DeoEsor / collapsible markdown.md
Created December 22, 2022 12:57 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@DeoEsor
DeoEsor / formal-languages.ipynb
Last active November 5, 2022 20:38
formal-languages.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DeoEsor
DeoEsor / address_generator.ipynb
Created September 19, 2022 08:51
address_generator.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DeoEsor
DeoEsor / LevenshteinDistanceExtension.cs
Last active July 10, 2022 00:17
.NET Levenshtein distance calculation extension
namespace OnlineCinema.Domain.Extensions; // just the project where i use this
public static class LevenshteinDistanceExtension
{
public static int LevenshteinDistance(this string value, string other)
{
int m = value.Length, n = other.Length;
var ed = new int[m, n];
for (var i = 0; i < m; ++i)
using System.Timers;
public class AsyncCaller : IAsyncDisposable
{
private System.Timers.Timer _timer;
private readonly CancellationTokenSource _tokenSource;
private readonly EventHandler _handler;
private bool _completedOk;
public AsyncCaller(EventHandler h)
public static class Server
{
private static int _count = 0;
private static readonly object Lock = new object();
public static void AddToCount(int value)
{
lock (Lock)
_count += value;
public class AsyncCaller : IAsyncDisposable
{
private System.Timers.Timer _timer;
private readonly CancellationTokenSource _tokenSource;
private readonly EventHandler Handler;
private bool _completedOk;
public AsyncCaller(EventHandler h)
{
_tokenSource = new CancellationTokenSource();
namespace Codity;
public class NumberOfDiscIntersections
{
const int MaxIntersectingPairs = 10000000;
public int solution(int[] A)
{
var result = 0;
int[] left = new int[A.Length],