Skip to content

Instantly share code, notes, and snippets.

View M-Yankov's full-sized avatar
💻
Driven by functionality, not by design

Mihail Yankov M-Yankov

💻
Driven by functionality, not by design
View GitHub Profile
@M-Yankov
M-Yankov / wp-index.js
Created January 7, 2024 20:25
show all tickera custom fields and their values. (field in database; field title). Open a custom form for edit and then execute the script.
jQuery('[name="tc_input_field_form_element[field_name][]"],[name="tc_select_field_form_element[field_name][]"]')
.map((i, x) => `${x.value} ${jQuery(x).nextAll('[name="tc_input_field_form_element[field_label][]"],[name="tc_select_field_form_element[field_label][]"]').get(0).value}`)
@M-Yankov
M-Yankov / RangeSlider.cs
Created February 25, 2024 22:01
Range Slider for MAUI
using System.ComponentModel;
using System.Diagnostics;
using MAUI = Microsoft.Maui.Controls.Shapes;
namespace TelemetryExporter.UI.CustomControls;
// It will be good that range slider to be Generic and initialize it from code behind.
// For example RangeSlider<T> where T : Struct (or something comparable)
public class RangeSlider : ContentView, INotifyPropertyChanged
@M-Yankov
M-Yankov / FrameRate.cs
Last active May 21, 2024 21:02
Calculate with C# next postion in timeline using timecodes start/end between clips for Davinci Resolve
using Sample;
var d1 = new DateTime(2024, 05, 11, 08, 31, 49); // End of Clip_00002
var d2 = new DateTime(2024, 05, 11, 13, 09, 20); // Start of Clip_00003
var res = d2 - d1;
Console.WriteLine("Diff {0}", res);
var timeLine = new DateTime(2024, 01, 1, 0, 1, 16) + res; // Last clip timeline end
Console.WriteLine("Put next video at {0:HH:mm:ss:ff}", timeLine); /// ?? Less than 4:33
@M-Yankov
M-Yankov / video.md
Created April 2, 2025 20:47
Github supports mp4 video
@M-Yankov
M-Yankov / Unittests.cs
Created August 7, 2025 11:46
Method for ILogger mock verification used i unit tests
private void SetupLogger(LogLevel logLevel, string partialMessageToContains, Times timesInvoked)
{
_loggerMock
.Setup(x => x.Log(
It.Is<LogLevel>(level => level == logLevel),
It.IsAny<EventId>(),
It.Is<It.IsAnyType>((o, t) => o.ToString().Contains(partialMessageToContains)),
It.IsAny<Exception?>(),
It.IsAny<Func<It.IsAnyType, Exception?, string>>()))
.Verifiable(timesInvoked, failMessage: $"Expect to contain {partialMessageToContains}");
@M-Yankov
M-Yankov / RidgeBorder.xaml
Created November 18, 2025 07:51
Ridge Groove border in .NET MAUI with hover effect
<ContentPage.Resources>
<LinearGradientBrush x:Key="OuterBrushNormal" StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#E0E0E0" Offset="0.5" />
<GradientStop Color="#282828" Offset="0.5" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="OuterBrushHover" StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#282828" Offset="0.5" />
<GradientStop Color="#E0E0E0" Offset="0.5" />
</LinearGradientBrush>
</ContentPage.Resources>