Skip to content

Instantly share code, notes, and snippets.

View aeged's full-sized avatar

Alexander Gednov aeged

View GitHub Profile
@aeged
aeged / dijkstra.py
Last active September 11, 2022 00:28
Dijkstra's algorithm implementation using networkx (for graph dependency) and python's built-in queue library.
# dependencies for our dijkstra's implementation
from queue import PriorityQueue
from math import inf
# graph dependency
import networkx as nx
"""Dijkstra's shortest path algorithm"""
def dijkstra(graph: 'networkx.classes.graph.Graph', start: str, end: str) -> 'List':
"""Get the shortest path of nodes by going backwards through prev list
@gvoze32
gvoze32 / ffmpeg GIF to MP4.MD
Last active September 18, 2026 05:02
Convert animated GIF to MP4 using ffmpeg in terminal.

To convert animation GIF to MP4 by ffmpeg, use the following command

ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4

Description

movflags – This option optimizes the structure of the MP4 file so the browser can load it as quickly as possible.

pix_fmt – MP4 videos store pixels in different formats. We include this option to specify a specific format which has maximum compatibility across all browsers.

@max-mapper
max-mapper / bibtex.png
Last active September 9, 2026 17:52
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png