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
| 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
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
| # 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
| 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
| 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() |
OlderNewer