Skip to content

Instantly share code, notes, and snippets.

View M-Yankov's full-sized avatar
💻
🤖🧭🏃‍♂️🚵‍♂️

Mihail Yankov M-Yankov

💻
🤖🧭🏃‍♂️🚵‍♂️
View GitHub Profile
@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 / RaceEventSites.md
Last active February 6, 2024 16:03
A web sites of events for trail running or bike
@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 / bike-shops-list.md
Last active March 4, 2022 15:21
Bike shop sites
  • Basebike
  • allmountain
  • niko bikes
  • hala bikes
  • pumpmybike.eu
  • 1001parts
  • veloserviz.com
  • bikeshop-bg.com
  • champion-bikeshop.com
  • pavebikeshop
@M-Yankov
M-Yankov / Article.md
Created February 24, 2022 19:15
An article for my blog

When working with nullable booleans and using null condiional operator could be wrong:

Let's take the follwoing example:
bool? isRecording = savedInstanceState?.GetBoolean("isRecording");

if (isRecording) - This won't compile. need another approach. The condition if (isRecording == false) will be true when the variable is equal to false and when it is null. It's logical to work like that since the default value of bool is false and the null value is more suitable to false. But we should be careful if the logic need to be executed only if it's equal to false.

@M-Yankov
M-Yankov / cmd.md
Created November 7, 2021 06:31
Andtoid export/backup database

Connect the phone

execute the following line in CMD as Administrator

cd "C:\Program Files (x86)\Android\android-sdk\platform-tools"
adb backup -f C:\Users\M.Yankov\Desktop\data.ab com.mihyan.simpletracker

In the phone screen Enable dubug if asked

@M-Yankov
M-Yankov / App.Config
Created September 18, 2019 22:26
A sample C# .NET CORE app using PredicateBuilder.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="LocalDb" connectionString="Data Source=LENOVO-G710;Initial Catalog=PredicateBuilder;Integrated Security=True" providerName=""/>
</connectionStrings>
</configuration>
@M-Yankov
M-Yankov / PdfGenerator.cs
Last active January 14, 2020 11:13
A code that generates a PDF document for testing (requires iTextSharp)
using System;
using System.IO;
using iText.Kernel.Colors;
using iText.Kernel.Pdf;
using iText.Layout;
using iText.Layout.Element;
public class Program
{
@M-Yankov
M-Yankov / colorful-scrollbar.as.css
Last active January 9, 2020 04:27 — forked from Sporif/dark-scrollbar.as.css
Dark scrollbar for Firefox 57. Tested on Windows 10. Requires https://gist.github.com/Sporif/db6b3440fba0b1bcf5477afacf93f875
scrollbar, scrollbar *:not(scrollbarbutton), scrollcorner {
-moz-appearance: none !important;
--scrollbar-width: 15px;
--scrollbar-height: var(--scrollbar-width);
}
scrollbar, scrollcorner {
background: #fff !important;
}
scrollbar[orient="vertical"] {
@M-Yankov
M-Yankov / select2cacheResults.js
Last active October 16, 2019 05:34
select2 dropdown: When loading results with ajax, load them once. (the results are always the same)
var s2data = $allUnitsSelect.select2({
ajax: {
url: '/GetValues',
dataType: 'json',
data: function (params) {
var query = {
text: text,
}
return query;