This file contains 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
#Based on code from http://superuser.com/questions/470319/how-to-enable-internet-connection-sharing-using-command-line | |
Function Set-NetConnectionSharing | |
{ | |
Param | |
( | |
[Parameter(Mandatory=$true)] | |
[string] | |
$InternetConnection, |
This file contains 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 IntPtr GetTerminalWindowHandle() | |
{ | |
try | |
{ | |
var currentProcess = Process.GetCurrentProcess(); | |
do | |
{ | |
var parentProcess = GetParentProcess(currentProcess.Handle); | |
This file contains 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/bash | |
# Função para verificar BOM UTF-8 | |
check_bom() { | |
local file=$1 | |
if [[ $(head -c 3 "$file") == $'\xEF\xBB\xBF' ]]; then | |
return 0 | |
else | |
return 1 | |
fi |
This file contains 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
class MBStringComparer : System.Collections.IComparer { | |
[int] Compare([object] $x, [object] $y) { | |
if($x.Contains('/')) | |
{ | |
$x = $x.Substring($x.LastIndexOf('/') + 1) | |
} | |
if($y.Contains('/')) | |
{ |
This file contains 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.Drawing; | |
using System.Windows.Forms; | |
namespace SampleForms | |
{ | |
public partial class SampleForm : Form | |
{ | |
public SampleForm() | |
{ |
This file contains 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 | |
( | |
# URL to the Azure DevOps incoming webhook endpoint. Expected format is | |
# https://dev.azure.com/<org>/_apis/public/distributedtask/webhooks/<svc-trig>/?api-version=6.0-preview. | |
[uri] | |
$Url, | |
# Shared secret used to sign the JSON payload. Must be the same value supplied during | |
# the creation of the Incoming Webhook service connection | |
[string] |
This file contains 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
trigger: | |
- master | |
resources: | |
- repo: self | |
variables: | |
azureSubscription: '<azure-subscription>' | |
dockerRegistryServiceConnection: '<service-connection>' | |
imageRepository: '<repository-name>' |
This file contains 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
@description('Specifies the name of the Azure Storage account.') | |
param storageAccountName string | |
@description('Specifies the name of the blob container.') | |
param containerName string = 'tfstate' | |
@description('Specifies the location in which the Azure Storage resources should be deployed.') | |
param location string = resourceGroup().location | |
@description('Specifies the SKU for the Storage Account.') |
This file contains 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
#requires -Modules TfsCmdlets | |
<# | |
.SYNOPSIS | |
Modifies the settings of a Git repository. | |
#> | |
Function Set-TfsGitRepositorySetting { | |
[CmdletBinding(SupportsShouldProcess = $true)] | |
Param ( | |
# Specifies the name of the setting to modify. |
This file contains 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 | |
Gets the settings of a Git repository. | |
#> | |
Function Get-TfsGitRepositorySetting { | |
[CmdletBinding()] | |
Param ( | |
# Specifies the name of the setting to retrieve. If not specified, all settings are returned. | |
[Parameter(Position = 0)] | |
[SupportsWildcards()] |
NewerOlder