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
namespace DotEnv | |
{ | |
public class DotEnv(ILogger<DotEnv> logger) | |
{ | |
/// <summary> | |
/// Holds a set of all environment variables set from .env files. Listed if logLevel set do debug. | |
/// </summary> | |
private readonly IDictionary<string, string> _finalEnvironmentVariables = new Dictionary<string, string>(); | |
private void LoadAndParse() |
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
const sanitizeCellValue = (value: unknown, cellSeparator: string): string => { | |
let valueString = String(value ?? "") | |
if ( | |
valueString.includes(cellSeparator) || | |
valueString.includes(" ") || | |
valueString.includes('"') || | |
valueString.includes("\n") | |
) { | |
valueString = valueString.replaceAll('"', '""') | |
valueString = `"${valueString}"` |
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
# Cheat-sheet for using dynamically defined variables between steps, jobs and stages in Azure DevOps Yaml Pipelines | |
# Documentation: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch | |
trigger: none | |
pr: none | |
stages: | |
- stage: DefineVarStage | |
jobs: | |
- job: DefineVarJob |
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
Show hidden characters
{ | |
"React Component": { | |
"prefix": "react-component", | |
"description": "Creates a react function component without props", | |
"body": [ | |
"import React from \"react\"", | |
"", | |
"export interface ${1:name}Props {", | |
"\t${0}", | |
"}", |
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 React from "react"; | |
// This can be defined in some other file as well. | |
interface SharedProps { | |
active: boolean | |
title?: string | |
} | |
type MyProps = Omit<SharedProps, "title"> & { | |
specialTitle: string |
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 React from "react" | |
import { SanityDocument as SanityQueryDocument, SanityDocumentStub } from "@sanity/client" | |
/** | |
* A Sanity name string. Can only a-z A-Z 0-9 and underscore. | |
*/ | |
export type SanityName = string | |
export interface SanitySelectorSet { | |
[key: string]: string |
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
export const conditionFunction = { | |
title: "Condition function", | |
name: "conditionFunction", | |
type: "object", | |
fields: [ | |
{ | |
title: "Function name", | |
name: "name", | |
type: "string", | |
description: "The type of condition", |
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 | |
This script demonstrates how to authenticate with the Microsoft Graph and update the redirect uris for an app registration | |
Requirements: | |
1. Register an application in the tenant (management app) | |
2. Grant the app the following API permissions: | |
- Application.ReadWrite.All |
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
/** | |
* A key for an entry in the cache. | |
*/ | |
type CacheKey = string | symbol | |
export class CacheError<TInnerError extends Error, TData> extends Error { | |
public constructor(public innerError: TInnerError, public data: TData) { | |
super(innerError.message) | |
} | |
} |
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
name: TEST-$(Date:yyyyMMdd)-$(Build.BuildId) | |
trigger: none | |
parameters: | |
- name: env | |
type: string | |
default: 'test' | |
variables: |
NewerOlder