Skip to content

Instantly share code, notes, and snippets.

View bgavrilMS's full-sized avatar

Bogdan Gavril bgavrilMS

  • Microsoft
  • Cambridge UK
View GitHub Profile
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
@bgavrilMS
bgavrilMS / retry.cs
Last active February 8, 2024 12:49
Retry Policy Idea
// This already exists, no changes
class NetworkRequest
{
public string Url;
public string Method;
public string Body;
public Dictionary<string, string> Headers;
}
@bgavrilMS
bgavrilMS / clone_gh_issue.ps1
Last active January 17, 2024 20:03
Clone GitHub issue cross MSAL repos
# 1. One time setup: install GH CLI https://cli.github.com/
# 2. Update $issue_to_clone and $target_repos variables
# 3. Manually update the project if needed (e.g. Customer Trust). Labels should be automatically cloned.
# Config - step 1
$issue_to_clone = "https://github.com/AzureAD/microsoft-authentication-library-for-java/issues/757"
$repo_java = 'https://github.com/AzureAD/microsoft-authentication-library-for-java/'
$repo_go = 'https://github.com/AzureAD/microsoft-authentication-library-for-go/'
$repo_py = 'https://github.com/AzureAD/microsoft-authentication-library-for-python/'
using System;
using System.Diagnostics.Tracing;
namespace ConsoleApp2.p4
{
/// <summary>
/// With Global PII setting.
/// </summary>
public class Prototype4
{
@bgavrilMS
bgavrilMS / IIdentityLogger.cs
Last active March 24, 2022 14:15
IIdentityLogger
using System;
using System.Diagnostics.Tracing;
using Windows.Security.Authentication.Web.Core;
namespace ConsoleApp2
{
internal class Program
{
static void Main(string[] args)
{
@bgavrilMS
bgavrilMS / CreateFileWithPermissions
Created March 21, 2022 15:55
CreateFileWithPermissions
Console.WriteLine("Hello World!");
//WellKnownSidType sid = WellKnownSidType.;
//FileSystemRights rights = FileSystemRights.FullControl;
//AccessControlType controlType = AccessControlType.Allow;
FileSecurity security = new FileSecurity();
var rights = FileSystemRights.Read | FileSystemRights.Write;
var adminIdentifier = new SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, null);
@bgavrilMS
bgavrilMS / dotnetcore_proxy.cs
Last active June 18, 2018 17:35
Use of proxy in dot net core
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
<?xml version="1.0" encoding="utf-8" ?>
<!--
This file defines properties which would be understood by the SonarQube Scanner for MSBuild, if not overridden (see below)
By default the MSBuild.SonarQube.Runner.exe picks-up a file named SonarQube.Analysis.xml in the folder it
is located (if it exists). It is possible to use another properties file by using the /s:filePath.xml flag
The overriding strategy of property values is the following:
- A project-specific property defined in the MSBuild *.*proj file (corresponding to a SonarQube module) can override:
- A property defined in the command line (/d:propertyName=value) has which can override:
- A property defined in the SonarQube.Analysis.xml configuration file [this file] which can override: