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
/* | |
This migration will delete all unused assets from the targeted Sanity dataset | |
*/ | |
import { defineQuery } from 'groq' | |
import { defineMigration, delete_ } from 'sanity/migrate' | |
const unrefedAssets = defineQuery(`*[_type in ['sanity.imageAsset', 'sanity.fileAsset']] { | |
_id, | |
'refs': count(*[references(^._id)]) | |
}[refs == 0][$start..$end]._id`) |
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 { Response, test } from '@playwright/test' | |
const pattern = new RegExp('some string...', 'i') | |
const urls = ['https://some.url.com/some/page.html'] | |
const requestURLValidator = (response: Response) => { | |
const requestURL = response.url() | |
if (pattern.test(requestURL)) { |
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
module.exports = { | |
root: true, | |
env: { | |
browser: true, | |
node: true, | |
}, | |
extends: [ | |
'eslint:recommended', | |
'plugin:vue/vue3-recommended', | |
'prettier' |
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
var Browser = (function() { | |
'use strict'; | |
var version = -1; | |
var isIE = false; | |
var map = { | |
'5.6': 6, | |
'5.7': 7, | |
'5.8': 8, | |
'9': 9, |
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([String] $prefix, [String] $path) | |
# Write-Out environment variables to file. | |
Get-ChildItem env:* | Where-Object Name -Like "$($prefix)*" | ForEach-Object { | |
$name = $_.Name.Replace("_", ".") | |
$key = $name -Replace ":([\d]+):", "[`${1}]" | |
Write-Output "$key=$($_.Value)" | |
} | Out-File -FilePath $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
public static class EnvironmentVariables { | |
public static void SetUp() { | |
var configFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "Environment.config"); | |
if(File.Exists(configFile)) { | |
var lines = File.ReadAllLines(configFile); | |
foreach(var line in lines) { | |
var index = line.IndexOf("=", StringComparison.Ordinal); |
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 static class DependencyResolution { | |
public static void ConfigureServices(IContainer container = null, ServiceCollection services = null) { | |
container = container ?? new Container(); | |
services = services ?? new ServiceCollection(); | |
container.Populate(services); | |
var provider = container.GetInstance<IServiceProvider>(); | |
HttpRuntime.WebObjectActivator = new HttpRequestScopedServiceProvider(provider); | |
} |
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
# This script runs our web-based tests, running IISExpress via TeamCity's | |
# dotCover, then runing the tests (also in dotCover) and then importing the | |
# test results and coverage results back into TeamCity. | |
# Note that some of the following is based on the comments by Tony Fabris on | |
# 20th Jan 2016 from here: https://youtrack.jetbrains.com/issue/DCVR-5921 | |
# Configuration. | |
# The path to IIS Express. | |
$IISExpressPath = "C:\Program Files (x86)\IIS Express\IISExpress.exe" |
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 static class StringConverter { | |
public static T To<T>(this string value) { | |
if(String.IsNullOrEmpty(value)) { | |
return default(T); | |
} | |
try { | |
var convertibleValue = (IConvertible)value; | |
var conversionType = Nullable.GetUnderlyingType(typeof(T)) ?? typeof(T); | |
return (T)convertibleValue.ToType(conversionType, CultureInfo.CurrentCulture); |
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 Archive-Logs { | |
[CmdLetBinding()] | |
PARAM ( | |
[string][parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$LogsPath, | |
[string][parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$ArchivesPath | |
) | |
BEGIN { | |
} | |
PROCESS { | |
$today = (Get-Date) |
NewerOlder