TestCafe's proxy breaks nullish coalescing. This is a basic demo using the syntax for a test case.
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 warning from 'warning'; | |
| import { Component } from 'react'; | |
| let idCounter = 0; | |
| function nextId() { | |
| idCounter += 1; | |
| warning( | |
| idCounter < 1e10, | |
| 'Id: you might have a memory leak.' + | |
| 'The idCounter is not supposed to grow that much.' |
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 warning from 'warning'; | |
| import { useState } from 'react'; | |
| let idCounter = 0; | |
| function nextId() { | |
| idCounter += 1; | |
| warning( | |
| idCounter < 1e10, | |
| 'Id: you might have a memory leak.' + | |
| 'The idCounter is not supposed to grow that much.' |
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
| MyContext.slice(value => value.foo); | |
| const KeyContext = useMemo(() => MyContext.slice(value => value[key]), [key]) | |
| const keyValue = useContext(KeyContext); | |
| const KeyContext = useMemo(() => MyContext.slice(value => value[key]), [key]) | |
| return <KeyContext.Consumer>{keyValue => keyValue}</KeyContext.Consumer> |
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
| echo "Setup WSL's Git to use the same credential manager that the Windows git.exe is using" | |
| GIT_CREDENTIAL_MANAGER_CORE_EXE=$(wslpath "$(git.exe config --global --get credential.helper | sed 's/\\\(\s\)/\1/g')" | sed 's/\(\s\)/\\\1/g') | |
| git config --global credential.helper "$GIT_CREDENTIAL_MANAGER_CORE_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
| #!/bin/bash | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| TAG="$1" | |
| if [ -z "$TAG" ]; then | |
| echo "Tag not specified" | |
| exit 1 | |
| fi |
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
| interface PromiseCachePending { | |
| promise: Promise<void>; | |
| } | |
| interface PromiseCacheResolved<T> { | |
| promise: Promise<void>; | |
| result: T; | |
| } | |
| interface PromiseCacheError { | |
| promise: Promise<void>; | |
| error: any; |
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 Axios, { AxiosError } from "axios"; | |
| // Casting/validation library | |
| class DataInputError extends Error { | |
| path: string[] = []; | |
| static isDataInputError(error: unknown): error is DataInputError { | |
| return error ? error instanceof DataInputError : false; | |
| } |
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 os, sys, re, shutil | |
| from subprocess import check_call, CalledProcessError | |
| AWS_VAULT_EXE = shutil.which('aws-vault.exe') | |
| def process_entry(pw_entry): | |
| if 'E' in pw_entry: | |
| print(pw_entry['E']) | |
| sys.exit(1) | |
| if 'OK' in pw_entry: |
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
| #!/bin/bash | |
| # Configuration | |
| # ACCESS_KEY="YOUR_ACCESS_KEY" | |
| # SECRET_KEY="YOUR_SECRET_KEY" | |
| # BUCKET="your-bucket-name" | |
| # REGION="your-region" | |
| # SUBPATH="your-subpath" | |
| # Function to upload a file |