- Frondoor Forward Header: https://learn.microsoft.com/en-us/azure/frontdoor/front-door-http-headers-protocol
- Official Doc: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-3.1
- https://endjin.com/blog/2023/01/correctly-configuring-asp-net-core-mvc-authentication-when-hosting-in-azure-container-apps
- https://anthonysimmon.com/securely-reverse-proxy-aspnet-core-web-apps/
- https://github.com/dotnet/aspnetcore/blob/v3.1.32/src/Middleware/HttpOverrides/test/ForwardedHeadersMiddlewareTest.cs#L238-L255
- https://github.com/dotnet/aspnetcore/blob/v3.1.32/src/Middleware/HttpOverrides/test/ForwardedHeadersMiddlewareTest.cs#L754-L775
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 { Pipe, Strings, Tuples, Numbers, Booleans, Call } from "hotscript"; | |
// ------ Helper Types ------- | |
type ParseDateString<Date extends string> = Pipe< | |
Date, | |
[ | |
Strings.Split<"/">, | |
Tuples.Map<Strings.ToNumber>, |
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 interface PaymentAdapterBase { | |
pay(amount: number): void; | |
} | |
export class PayPalAdapter implements PaymentAdapterBase { | |
pay(amount: number): void { |
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 express from 'express'; | |
import morgan from 'morgan'; | |
import swaggerUi from 'swagger-ui-express'; | |
import { extendZodWithOpenApi, OpenApiGeneratorV3, OpenAPIRegistry } from '@asteasolutions/zod-to-openapi'; | |
import { z } from 'zod'; | |
extendZodWithOpenApi(z); | |
const host = process.env.HOST ?? 'localhost'; | |
const port = process.env.PORT ? Number(process.env.PORT) : 3000; |
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
Param( | |
[Parameter(Mandatory=$true)] | |
# ID for the Azure subscription containing the App Service | |
[string]$SubscriptionId, | |
[Parameter(Mandatory=$true)] | |
# Name of the App Service on which the restart should be performed | |
[string]$AppServiceName, | |
[Parameter(Mandatory=$false)] | |
# Seconds between each instance restart, defaults to 30 | |
[int]$SecondsBetweenRestarts = 30 |
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
// Inspired by react-hook-form | |
import { useRef } from 'react'; | |
import { z } from 'zod'; | |
interface UseFormOption<T> { | |
defaultValues: T; | |
schema: z.AnyZodObject; | |
} |
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
#!/usr/bin/env node_modules/.bin/vite-node --watch | |
// `vite-node` HMR handler for servers. | |
type TeardownCallback = () => Promise<void>; | |
type Listener = () => TeardownCallback; | |
declare global { | |
// eslint-disable-next-line no-var | |
var __HMR__: { | |
listeners: ReadonlyArray<Listener>; |
Create a new repository, or reuse an existing one.
Generate a new SSH key:
ssh-keygen -t rsa -C "[email protected]"
Copy the contents of the file ~/.ssh/id_rsa.pub
to your SSH keys in your GitHub account settings (https://github.com/settings/keys).
Test SSH key:
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
#!/usr/bin/env node | |
var fs = require('fs'), | |
https = require('https'); | |
// We pass our client key & cert to the http agent, | |
// which we then use to make the request. | |
var agentOptions = { | |
key: fs.readFileSync('client.key'), | |
cert: fs.readFileSync('client.crt'), |
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
/* | |
* Legit auto pop by Noxturnix | |
* Version 0.3 | |
* | |
* How to use: | |
* 1. Go to https://popcat.click/ | |
* 2. Press F12 | |
* 3. Go to "Console" tab | |
* 4. Ignore the warning. There's no such malicious codes in this script. You can try to understand the code if you want | |
* 5. Copy and paste this script |
NewerOlder