Skip to content

Instantly share code, notes, and snippets.

@revocengiz
revocengiz / MyTestApi.csproj
Created November 29, 2023 11:33 — forked from joperezr/MyTestApi.csproj
How to use Redaction in Logging using the new Microsoft.Extensions.Compliance.Redaction package. For the full Guide, checkout the README.md file on the gist.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
@revocengiz
revocengiz / craver-vs.omp.json
Created October 7, 2021 13:50 — forked from DamianEdwards/craver-vs.omp.json
My oh-my-posh profile
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"console_title": true,
"console_title_style": "template",
"console_title_template": "{{if .Root}}(Admin) {{end}}{{.Folder}}",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
Import-Module posh-git
Import-Module oh-my-posh
Import-Module -Name Terminal-Icons
Set-PoshPrompt -Theme ~/Documents/WindowsPowerShell/craver.omp.json
namespace System.Collections.Generic
{
public static class ConcurrentDictionaryExtensions
{
/// <summary>
/// Provides an alternative to <see cref="ConcurrentDictionary{TKey, TValue}.GetOrAdd(TKey, Func{TKey, TValue})"/> that disposes values that implement <see cref="IDisposable"/>.
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
/// <param name="dictionary"></param>
@revocengiz
revocengiz / knockout.bindings.js
Created March 7, 2016 19:40 — forked from ivanovvitaly/knockout.bindings.js
My simple and usefull knockout binding handlers I always use
// Requires BlockUI
ko.bindingHandlers.blockUI = {
update: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
var isEnabled = ko.unwrap(valueAccessor()) || false;
if (isEnabled) {
$(element).block();
}
else {
$(element).unblock();
}