Skip to content

Instantly share code, notes, and snippets.

View liquidcarbon's full-sized avatar
🙃

Alexander Kislukhin liquidcarbon

🙃
  • Colorful Colorado
View GitHub Profile
@fangkuoyu
fangkuoyu / molecule_graph.py
Created September 13, 2021 14:28
Converting RDKit to Networkx
# import library --------------------------------------------------------------
from rdkit import Chem
import networkx as nx
import matplotlib.pyplot as plt
# define the smiles string and covert it into a molecule sturcture ------------
caffeine_smiles = 'CN1C=NC2=C1C(=O)N(C(=O)N2C)C'
caffeine_mol = Chem.MolFromSmiles(caffeine_smiles)
# define the function for coverting rdkit object to networkx object -----------
@gvoze32
gvoze32 / ffmpeg GIF to MP4.MD
Last active March 18, 2025 15:44
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.