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
export default function copyHeaders() { | |
const headers = new Headers(); | |
headers.append("set-cookie", "cookie1=value1"); | |
headers.append("set-cookie", "cookie2=value2"); | |
const response = new Response(undefined, { headers }); | |
console.log( | |
`before (length ${headers.getSetCookie().length}): `, | |
headers.getSetCookie() |
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
export function toHaveDateValue(this: jest.MatcherContext, input: HTMLInputElement, expectedDate: Date) { | |
const normalizedInputValue = input.value | |
.replace(/\u200e|\u2066|\u2067|\u2068|\u2069/g, '') | |
.replace(/ \/ /g, '/') | |
const actualDate = new Date(normalizedInputValue) | |
return { | |
pass: actualDate.getTime() === expectedDate.getTime(), | |
message: () => { | |
const to = this.isNot ? 'not to' : 'to' |
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
[ | |
"<h1>Google Cloud Platform</h1>", | |
"Amazon AWS", | |
"Docker", | |
"Digital Ocean" | |
] |
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 React from 'react' | |
// Replace the line with the commented and the warning is shown during test. The current line doesn't cause any warnings. | |
// const simulatedApiCall = async () => {} | |
const simulatedApiCall = () => new Promise(resolve => setTimeout(resolve, 100)) | |
const MyTest: React.FC = props => { | |
const [isLoading, setLoading] = React.useState(true) | |
const mounted = React.useRef(false) |
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
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
annotations: | |
kubernetes.io/ingress.class: nginx-external | |
name: cm-acme-http-solver-lrsn9 | |
spec: | |
rules: | |
- host: service.domain.com | |
http: |
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
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
annotations: | |
kubernetes.io/ingress.class: nginx-internal | |
name: service | |
spec: | |
rules: | |
- host: service.domain.com | |
http: |
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
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: nginx-configuration-external | |
namespace: infra | |
labels: | |
app: nginx-ingress | |
tier: external | |
--- |
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
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: nginx-configuration-internal | |
namespace: infra | |
labels: | |
app: nginx-ingress | |
tier: internal | |
--- |
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
public class MyDbContext : DbContext | |
{ | |
private ITenantIdLocator tenantIdLocator; | |
public MyDbContext(ITenantIdLocator tenantIdLocator) | |
{ | |
if (tenantIdLocator == null) throw new ArgumentNullException(nameof(tenantIdLocator)); | |
this.tenantId = tenantIdLocator.GetTenantId(); | |
} | |
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
phases: | |
- phase: Phase1 | |
steps: | |
- powershell: Write-Host "##vso[task.setvariable variable=OutputVar;]UpdatedValueInScript" | |
displayName: Create variable | |
- powershell: Write-Host $env:OutputVar | |
displayName: Print variable | |
# env: | |
# OutputVar: $(OutputVar) |
NewerOlder