Skip to content

Instantly share code, notes, and snippets.

View test.json
[
"<h1>Google Cloud Platform</h1>",
"Amazon AWS",
"Docker",
"Digital Ocean"
]
@nphmuller
nphmuller / MyComponent.jsx
Last active May 29, 2020
react-act-warning-repro
View MyComponent.jsx
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)
View cert-ingress.yaml
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:
View service-ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx-internal
name: service
spec:
rules:
- host: service.domain.com
http:
View gist:e8eebd523dae6490265957bf5b58a571
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-configuration-external
namespace: infra
labels:
app: nginx-ingress
tier: external
---
View gist:41eb9593bdb9e671375eda5ca077c230
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-configuration-internal
namespace: infra
labels:
app: nginx-ingress
tier: internal
---
@nphmuller
nphmuller / MyDbContext.cs
Last active Sep 27, 2022
CombineQueryFilers
View MyDbContext.cs
public class MyDbContext : DbContext
{
private ITenantIdLocator tenantIdLocator;
public MyDbContext(ITenantIdLocator tenantIdLocator)
{
if (tenantIdLocator == null) throw new ArgumentNullException(nameof(tenantIdLocator));
this.tenantId = tenantIdLocator.GetTenantId();
}
View .vsts-ci.yml
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)
View gist:542fc1514c985b067c89720d96681b25
2018-06-07T15:21:06.6052998Z ##[section]Starting: Push image
2018-06-07T15:21:06.6123753Z ==============================================================================
2018-06-07T15:21:06.6140246Z Task : Docker
2018-06-07T15:21:06.6156363Z Description : Build, tag, push, or run Docker images, or run a Docker command. Task can be used with Docker or Azure Container registry.
2018-06-07T15:21:06.6172754Z Version : 0.3.12
2018-06-07T15:21:06.6188076Z Author : Microsoft Corporation
2018-06-07T15:21:06.6204321Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=848006)
2018-06-07T15:21:06.6220508Z ==============================================================================
2018-06-07T15:21:07.1468544Z [command]/usr/local/bin/docker push [company].azurecr.io/[app]:9389
2018-06-07T15:21:27.3224626Z The push refers to repository [[company].azurecr.io/[app]]
View service-with-ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx
spec:
rules:
- host: nginx.example.org
http:
paths:
- backend: