Skip to content

Instantly share code, notes, and snippets.

View AnteaterKit's full-sized avatar

AnteaterKit AnteaterKit

View GitHub Profile
imports
HttpModule
BullModule.forRootAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => {
const connection = configService.get('redisconnection');
return {
connection: connection,
}
},

Более удобной и актуальной версией является эта статья с использованием traefik

https://gist.github.com/dancheskus/365e9bc49a73908302af19882a86ce52


Certbot и nginx, как обратный прокси в Docker (пример с 2 react проектами)

В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам

docker run -d \
--name=wg-easy \
-e WG_HOST=YOUR_SERVER_IP \
-e PASSWORD=YOUR_ADMIN_PASSWORD \
-v ~/.wg-easy:/etc/wireguard \
-p 51820:51820/udp \
-p 51821:51821/tcp \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
export class WhiteBoardMovedState extends WhiteBoardState {
public handleTouchstart(e: any): void {
this.whiteBoard.touchStartStage(e.evt);
}
public handleTouchend(e: any): void {
const position = e.currentTarget.position();
this.whiteBoard.offsetX = -position.x;
this.whiteBoard.offsetY = -position.y;
this.whiteBoard.backLayerRender.updateGrid(this.whiteBoard.width, this.whiteBoard.height, position.x, position.y, this.whiteBoard.scaleOffset);
export class WhiteBoard {
public whiteBoardState: WhiteBoardState;
toReadOnlyState() {
this.setState(new WhiteBoardReadOnlyState());
}
toShapeState(shapeType: ShapeTypes) {
this.setState(new WhiteBoardShapedState());
}
...
}
export abstract class WhiteBoardState {
protected whiteBoard: WhiteBoard;
setWhiteBoard(whiteBoard: WhiteBoard) {
this.whiteBoard = whiteBoard;
}
public abstract getTool(): SelectedTool;
public abstract handleClick(e): void;
public abstract handleDragend(e): void;
public abstract handleMousedown(e): void;
public abstract handleMouseup(e): void;
declare const Konva: any;
/*
* BackLayer render of infinitely whiteboard
*/
export class BackLayerRender {
currentX = -120;
currentY = -120;
width = 0;
import Konva from "konva";
import { BackLayerRender } from "./backLayerRender";
export class WhiteBoard {
stage!: Konva.Stage;
mainLayer!: Konva.Layer;
backLayer!: Konva.Layer;
private backLayerRender!: BackLayerRender;
// global-setup.ts
import { chromium, FullConfig } from '@playwright/test';
async function globalSetup(config: FullConfig) {
// const { baseURL } = config.projects[0].use;
// const browser = await chromium.launch();
// await browser.close();
}
import { PlaywrightTestConfig, devices } from '@playwright/test';
/*
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
globalSetup: require.resolve('./e2e/global-setup'),
testDir: './e2e',