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 { SVGDrawFunction } from "@tisoap/react-flow-smart-edge/src/functions/drawSvgPath"; | |
import { XYPosition } from "reactflow"; | |
const distance = (a: XYPosition, b: XYPosition) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2)); | |
function getBend(a: XYPosition, b: XYPosition, c: XYPosition, size: number): string { | |
const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size); | |
const { x, y } = b; | |
// no bend |
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
version: "3" | |
networks: | |
kong-net: | |
driver: bridge | |
services: | |
####################################### | |
# Postgres: The database used by Kong |
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
defmodule Solution do | |
#Enter your code here. Read input from STDIN. Print output to STDOUT | |
end | |
array_length = IO.read(:stdio, :line) | |
array = IO.read(:stdio, :line) | |
array_length | |
|> String.trim | |
|> String.to_integer |
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
ffmpeg -y -i input.mp4 -vf fps=10,scale=716:-1:flags=lanczos,palettegen palette.png | |
ffmpeg -i input.mp4 -i palette.png -filter_complex "fps=10,scale=716:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
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
#include <stdio.h> | |
#include <cuda.h> | |
#include <cuda_runtime_api.h> | |
/* Outputs some information on CUDA-enabled devices on your computer, | |
* including compute capability and current memory usage. | |
* | |
* On Linux, compile with: nvcc -o cuda_check cuda_check.c -lcuda | |
* On Windows, compile with: nvcc -o cuda_check.exe cuda_check.c -lcuda | |
* |
NewerOlder