Skip to content

Instantly share code, notes, and snippets.

dimonovdd /
Last active February 1, 2024 15:25
MacOS install MSBuild
# Rosseta
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
# Xcode Command Line Tools (Need Xcode)
xcode-select --install
sudo xcode-select -s /Applications/
# Microsoft OpenJDK 11
dimonovdd / file.cs
Last active December 9, 2022 15:30
Try detect msbuild for cake macOS
public static class TestClass
static string GetMsBuildPath(int versionMajor, string pathContains)
var defaultDirectories = new[]
Path.Combine(System.Environment.GetEnvironmentVariable("HOME"), "Library/Caches/VisualStudio"),
<script src=""></script>
<h1>HybridWebView Test</h1>
<br />
Enter name: <input type="text" id="name">
<br />
<br />
<button type="button" onclick="javascript: invokeCSCode($('#name').val());">Invoke C# Code</button>
<br />
document.body.addEventListener('click', function(e) {
e = e || window.event;
var target = || e.srcElement;
Native('invokeClick', 'tag='+target.tagName+' id='' name=';
}, true /* to ensure we capture it first*/);
public static class PageSpecific
public static readonly BindableProperty BackSwipeEnableProperty =
BindableProperty.Create("BackSwipeEnable", typeof(bool), typeof(Page), true, BindingMode.OneTime);
public static bool GetBackSwipeEnable(BindableObject element)
=> (bool) element.GetValue(BackSwipeEnableProperty);
public static void SetBackSwipeEnable(BindableObject element, bool value)
=> element.SetValue(BackSwipeEnableProperty, value);
dimonovdd / DisplayHelper.cs
Created December 16, 2021 08:47
Best practice for SafeArea on iOS (Xamarin, MAUI)
using System.Linq;
using Foundation;
using Xamarin.Essentials;
using Xamarin.Forms;
namespace MyNamespace
public class DisplayHelper
const string IphoneModelPrefix = "iphone";
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<!--<Target Name="GenerateResx" AfterTargets="BeforeBuild">
<Message Text="Check Resources.Designer.cs" Importance="high" />
<Message Text="Generating Designer Files..." />
<GenerateResource Sources="@(EmbeddedResource)" StronglyTypedLanguage="cs" StronglyTypedClassName="%(Filename)" StronglyTypedNamespace="@(EmbeddedResource-&gt;'%(CustomToolNamespace)')" StronglyTypedFileName="@(EmbeddedResource-&gt;'%(RootDir)%(Directory)%(Filename).designer.cs')" PublicClass="true" />
using System;
using System.Threading.Tasks;
namespace Sync
public static class RunSyncUtil
private static readonly TaskFactory factory = new
=== Visual Studio Community 2019 for Mac ===
Version 8.8.10 (build 2)
Installation UUID: f8caf6ef-1bee-4228-a7ca-ccc3745efdd9
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac (d16-6 / 088c73638)
Package version: 612000122
=== Mono Framework MDK ===
dimonovdd / Pharmacist.NuGet.g.cs
Created February 21, 2021 17:32
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// <auto-generated>
// This code was generated from a template.
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.