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 anyHostname = builders.randomHostname(10) | |
private anyToken = builders.randomToken(10) | |
private anyResourcePath = builders.randomPathName(8) ~ "/" ~ builders.randomPathName(8) | |
private emptyResponse = "[]" | |
Test2(Fixture, "Fetching a resource passes the access token in the PRIVATE-TOKEN header", () => { | |
token = builders.randomToken(12) | |
getMethod = (url, headers) => { | |
assert.that(headers, isTableWithKey("PRIVATE-TOKEN"), "The access token header is missing") | |
assert.that(get(headers, "PRIVATE-TOKEN", ""), isEqualTo(token), "The access token was incorrect") |
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 | |
Scans the dub.selections.json files under a folder looking for | |
inconsistent versions of the same package dependency. | |
.description | |
Ideally your projects should always be using a consistent set of | |
package versions to avoid impedance mismatches. This script analyses | |
all the packages used by your projects (e.g. libraries) and tells you | |
if multiple package versions are being referenced. |
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.Reflection; | |
using System.Runtime.InteropServices; | |
[assembly:Guid("11111111-2222-3333-4444-555555555555")] | |
namespace GUID_Test | |
{ | |
class Program | |
{ |
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
<?xml version="1.0" encoding="utf-8"?> | |
<unattend xmlns="urn:schemas-microsoft-com:unattend"> | |
<settings pass="windowsPE"> | |
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<SetupUILanguage> | |
<UILanguage>en-US</UILanguage> | |
</SetupUILanguage> | |
<SystemLocale>en-US</SystemLocale> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<unattend xmlns="urn:schemas-microsoft-com:unattend"> | |
<settings pass="windowsPE"> | |
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" | |
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<DiskConfiguration> | |
<Disk> | |
<CreatePartitions> | |
<CreatePartition> |
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
Set-StrictMode -Version Latest | |
$ErrorActionPreference = 'stop' | |
$instance = '.\SQLEXPRESS' | |
$database = 'database' | |
$configuration = "Server=$instance;Database=$database;Trusted_Connection=True;" | |
$connection = New-Object System.Data.SqlClient.SqlConnection $configuration | |
$connection.Open() | |
$command = $connection.CreateCommand() |
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 | |
Shows which build configurations are supported for which projects in a | |
Visual Studio solution file (.sln). | |
.description | |
With a large Visual Studio solution that has more than just the default | |
build configurations it's easy for them to get out of step. This script | |
analyses a .sln file and shows you which build configurations are | |
available for which projects so that you can find inconsistencies. |
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
Set-StrictMode -Version Latest | |
$ErrorActionPreference = 'stop' | |
$configuration = 'Server=.\SQLEXPRESS;Database=master;Trusted_Connection=True;' | |
$connection = New-Object System.Data.SqlClient.SqlConnection $configuration | |
$connection.Open() | |
$handler = [System.Data.SqlClient.SqlInfoMessageEventHandler] { | |
param($sender, $event) |
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
import requests | |
import argparse | |
import sys | |
def listVenues(): | |
response = requests.get(f'{baseUrl}/venue?limit=1000&offset=0') | |
json = response.json() | |
for venue in json['data']: | |
id = venue['id'] |
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
namespace JsonTests | |
{ | |
public class CustomJsonConverter : JsonConverter | |
{ | |
public override bool CanConvert(Type objectType) | |
{ | |
return typeof(BaseType).IsAssignableFrom(objectType); | |
} | |
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) |
NewerOlder