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/python3 | |
| import urllib.request | |
| import json | |
| import subprocess | |
| """ | |
| Small python script to download all of someone's github repos | |
| """ | |
| GITHUB_USERNAME='' |
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
| public interface IN<in U> {} | |
| public interface IC<X> : IN<IN<IC<IC<X>>>> {} | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| IC<double> bar = null; | |
| IN<IC<string>> foo = bar; | |
| } |
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
| public class Undecidable | |
| { | |
| class T {} | |
| class N<Z> {} | |
| class C<X> extends N<N<? super C<C<X>>>> | |
| { | |
| private N<? super C<T>> cast(C<T> c) | |
| { |
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
| {-# LANGUAGE | |
| MultiParamTypeClasses, | |
| FunctionalDependencies, | |
| FlexibleInstances, | |
| TypeFamilies #-} | |
| class Mul' a b where | |
| type MulT a b | |
| mul' :: a -> b -> MulT a b |
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
| # Copyright (c) Microsoft. All rights reserved. | |
| # Licensed under the MIT license. | |
| # Requires PowerShell, git and VSCode | |
| param( | |
| [switch]$NoPackage, | |
| [switch]$LaunchVSCode | |
| ) |
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
| private static RunspacePool CreatePssaRunspacePool() | |
| { | |
| // Use public but unfriendly APIs to import a PSScriptAnalyzer module with the needed minimum version | |
| var pssaModuleSpec = new ModuleSpecification(new Hashtable() | |
| { | |
| { "ModuleName", PSSA_MODULE_NAME }, | |
| { "ModuleVersion", s_pssaMinimumVersion } | |
| }); |
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
| param( | |
| [ValidateNotNullOrEmpty()] | |
| [string]$KeyFileName, | |
| [ValidateNotNullOrEmpty()] | |
| [string]$KeyFileDir = $null | |
| ) | |
| # Test if the given Windows Identity is the Built-in Administrator | |
| function Test-IsAdministrator | |
| { |
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.Generic; | |
| using System.IO; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Linq; | |
| namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol | |
| { |
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
| function Enable-WritingToPath { | |
| param([string]$Path) | |
| # This is not a problem on Windows | |
| if (-not ($IsMacOS -or $IsLinux)) { | |
| return | |
| } | |
| Write-Verbose "Setting permissions on path: $Path" |
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
| $badBytes = [byte[]]@(0xC3, 0x80) | |
| $utf8Str = [System.Text.Encoding]::UTF8.GetString($badBytes) | |
| $bytes = [System.Text.Encoding]::ASCII.GetBytes('Write-Output "') + [byte[]]@(0xC3, 0x80) + [byte[]]@(0x22) | |
| $path = Join-Path ([System.IO.Path]::GetTempPath()) 'encodingtest.ps1' | |
| try | |
| { |
OlderNewer