Methane and carbon dioxide storage in a porous van der Waals crystal