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
// This is an example of Dijkstra's algorithm. https://leetcode.com/problems/network-delay-time/ | |
function createAdjList(edges, n) { | |
const adjList = new Map() | |
for(let i=0; i<n; i++) adjList.set(i, []) | |
for(let i=0; i<edges.length; i++) { | |
const [from, to, weight] = edges[i] | |
const neighbors = adjList.get(from) | |
neighbors.push({ node: to, weight }) | |
adjList.set(from, neighbors) | |
} |
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
@Get(':hash') | |
@Header('Content-Type', 'image/png') | |
async getActiveImageByHash( | |
@Param('hash') hash: string, | |
@Res() response: Response, | |
): Promise<any> { | |
const res = await this.usersService.getActiveImageByHash(hash); | |
// Connect to s3 | |
const client = new S3Client({ | |
region: REGION, |
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
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.1 | |
container_name: elasticsearch | |
ports: | |
- "9200:9200" | |
- "9300:9300" | |
environment: | |
- discovery.type=single-node | |
- xpack.security.enabled=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
# docker-compose.yml for log-server | |
services: | |
loki: | |
image: grafana/loki:2.8.0 | |
ports: | |
- "3100:3100" | |
volumes: | |
- loki-data:/loki | |
restart: unless-stopped |
OlderNewer