Skip to content

Instantly share code, notes, and snippets.

View ttkoma's full-sized avatar

Konstantin Lapeev ttkoma

  • Russian Federation
View GitHub Profile
@ttkoma
ttkoma / *.csproj
Last active June 2, 2020 23:14
Autonumbering version .net core >=3.0
<PropertyGroup Label="Assembly Versioning">
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Build>$([System.DateTime]::Now.Date.Subtract($([System.DateTime]::Parse(`2000-01-01`))).TotalDays)</Build>
<Revision>$([System.Convert]::ToUInt16( $([MSBuild]::Divide($([System.DateTime]::Now.TimeOfDay.TotalSeconds), 2 )) ))</Revision>
<AssemblyVersion>$(VersionMajor).$(VersionMinor).$(Build).$(Revision)</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<InformationalVersion>$(AssemblyVersion)-preview</InformationalVersion>
</PropertyGroup>
@ttkoma
ttkoma / nuxt.store.plugin.ts
Last active August 17, 2023 13:56
nuxt-auth + pinia instead vuex
import { Context, Plugin } from "@nuxt/types";
import Vue from "vue";
import { defineStore, PiniaPluginContext } from "pinia";
import { ref, set } from "@nuxtjs/composition-api";
export const useAuthStore = defineStore({
id: "auth",
state: () => ({
busy: false,
@ttkoma
ttkoma / StringExtensions.cs
Created September 29, 2022 14:23
TripleEncodingChars
public static string TripleEncodeSymbol(this string input, string targetSymbol, string firstSymbol = "$", string secondSymbol = "Z")
{
if (targetSymbol == firstSymbol)
throw new ArgumentOutOfRangeException($"{nameof(targetSymbol)} can't be equal {nameof(firstSymbol)}");
if (targetSymbol == secondSymbol)
throw new ArgumentOutOfRangeException($"{nameof(targetSymbol)} can't be equal {nameof(secondSymbol)}");
//return input.Replace("$", "$$$").Replace("Z", "$$Z").Replace(":", "$ZZ");
#
# diff all
###WARNING: NO CUSTOM DEFAULTS FOUND###
# version
# Betaflight / STM32F411 (S411) 4.1.0 Oct 16 2019 / 11:57:34 (c37a7c91a) MSP API: 1.42
# manufacturer_id: MTKS board_name: MATEKF411RX custom defaults: NO
# start the command batch