Skip to content

Instantly share code, notes, and snippets.

View gfraiteur's full-sized avatar

Gael Fraiteur gfraiteur

View GitHub Profile
@gfraiteur
gfraiteur / Metalama-CLA.md
Created April 2, 2025 15:46
Metalama CLA

This Contribution License Agreement (“Agreement”) is between SharpCrafters s.r.o. with its registered office at Prague 5, nám. 11. října 1307/2, Postal Code 150 00, the Czech Republic, ID 28953690 (“Maintainer”), and the person or entity signing below (“You”).

This Agreement conveys certain license rights to Maintainer for Your contributions to Maintainer’s open source projects. This Agreement is effective as of the latest signature date below ("Effective Date").

1. Definitions

Code means the computer software code, whether in human-readable or machine-executable form, that is delivered by You to Maintainer under this Agreement.

Project means any of the projects owned or managed by Maintainer and offered under a license approved by the Open Source Initiative.

@gfraiteur
gfraiteur / Microsoft.PowerShell_profile.ps1
Last active January 3, 2022 15:04
My PowerShell profile
# Save this file to: C:\Users\GaelFraiteur\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
# PowerShell parameter completion shim for the dotnet CLI
Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
dotnet complete --position $cursorPosition "$wordToComplete" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
/// <summary>
/// Appends the indent string, context description, and the record kind to the current <see cref="StringBuilder"/>.
/// </summary>
protected virtual void AppendProlog()
{
#if DEBUG
if ( this.StringBuilder != this.actionStringBuilder )
throw new AssertionFailedException();
#endif
Param
(
[string] $artifactsPath,
[string] $scanResponsePath = ''
)
$ErrorActionPreference = "Stop"
trap
{
@gfraiteur
gfraiteur / gist:1834882
Created February 15, 2012 10:16
Debug a StackOverflowException in 1 minute with PostSharp
using System;
using PostSharp.Aspects;
using PostSharp.Aspects.Configuration;
using PostSharp.Aspects.Serialization;
using Resonance.Messenging.Diagnostics;
[assembly: StackOverflowDetection]
namespace Resonance.Messenging.Diagnostics
{
@gfraiteur
gfraiteur / gist:1471809
Created December 13, 2011 11:34
A debugging aspect that throws an exception is an object is used by several threads simultaneously
using System.Diagnostics;
using System.Threading;
using PostSharp.Aspects;
using PostSharp.Aspects.Advices;
using PostSharp.Aspects.Configuration;
using PostSharp.Aspects.Serialization;
using PostSharp.Extensibility;
namespace Resonance.Messenging.Threading
{
using System.Collections.Generic;
using System.Xml;
using PostSharp.Sdk.CodeModel;
namespace PostSharp.AddIn.PostObfuscation.Dotfuscator
{
internal sealed class DotfuscatorMap : ObfuscationMap
{
protected override string GetSignature( IWriteReflectionName member )
{