This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/sh | |
| # git-purge-remote.sh | |
| # Deletes all remote branches for a given remote, except HEAD and main. | |
| # Name of the remote to purge. Change if needed. | |
| REMOTE_NAME=origin | |
| # List all remote branches for the given remote, excluding HEAD and main. | |
| # Pipe the branch names to git push to delete them | |
| # xargs -r prevents git push from running if there are no branches | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import os | |
| import pathlib | |
| import sys | |
| def ensure_final_newline(root_dir=".", extension=".cs"): | |
| """ | |
| Ensures that all files with the given extension under root_dir | |
| end with exactly one newline. | |
| """ | |
| if not extension.startswith("."): | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import os | |
| import pathlib | |
| def ensure_final_newline_in_resx(root_dir="."): | |
| """ | |
| Ensures that all .resx files under root_dir end with exactly one newline. | |
| """ | |
| root = pathlib.Path(root_dir) | |
| resx_files = list(root.rglob("*.resx")) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env python3 | |
| """ | |
| find_unreferenced_cs.py | |
| Finds all *.cs files under a given directory and lists the ones | |
| whose **filename** is not mentioned in ANY *.csproj or *.projitems in the repo. | |
| Run from repo root: | |
| python3 find_unreferenced_cs.py --dir src/libraries/Common/src/Interop | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | using System; | |
| using System.Collections; | |
| using System.Linq; | |
| using BenchmarkDotNet.Attributes; | |
| [MemoryDiagnoser] | |
| public class Benchmarks | |
| { | |
| private readonly IDictionary _dict = Enumerable.Range(0, 10000).ToDictionary(i => i.ToString(), i => string.Empty); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Running; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| [MemoryDiagnoser] | |
| [DisassemblyDiagnoser] | |
| public class Program | |
| { | |
| private List<int> list = Enumerable.Repeat(10, 10).ToList(); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ## .NET Core 5.0.2 (CoreCLR 5.0.220.61120, CoreFX 5.0.220.61120), X64 RyuJIT | |
| ```assembly | |
| ; Program.ContainsStringLocal() | |
| mov rdx,197EA839518 | |
| mov rdx,[rdx] | |
| mov rcx,[rcx+8] | |
| cmp [rcx],ecx | |
| jmp near ptr System.String.Contains(System.String) | |
| ; Total bytes of code 24 | |
| ``` | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Running; | |
| using System; | |
| [MemoryDiagnoser] | |
| [DisassemblyDiagnoser] | |
| public class Program | |
| { | |
| private string str = "whatever"; | |
| private string find = "a"; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <# | |
| .Synopsis | |
| Rough PS functions to create new user profiles | |
| .DESCRIPTION | |
| Call the Create-NewProfile function directly to create a new profile | |
| .EXAMPLE | |
| Create-NewProfile -Username 'testUser1' -Password 'testUser1' | |
| .NOTES | |
| Created by: Josh Rickard (@MS_dministrator) and Thom Schumacher (@driberif) |