Skip to content

Instantly share code, notes, and snippets.

View LiteApplication's full-sized avatar
🎯
Focusing on school

Alexis Rossfelder LiteApplication

🎯
Focusing on school
  • High School
  • Paris, France
View GitHub Profile
@cbwar
cbwar / mime.py
Last active September 22, 2022 07:52
Python: Get mime type from file
# https://stackoverflow.com/questions/43580/how-to-find-the-mime-type-of-a-file-in-python
import magic
mime = magic.Magic(mime=True)
mime.from_file("testdata/test.pdf") # 'application/pdf'
@jtbr
jtbr / exe_dir.h
Created June 1, 2018 11:22
Find the path to (directory containing) the currently running executable (cross-platform C++ function)
#ifndef __EXE_DIR_H__
#define __EXE_DIR_H__
#include <string>
#include <boost/predef/os.h>
#if (BOOST_OS_WINDOWS)
# include <stdlib.h>
#elif (BOOST_OS_SOLARIS)
# include <stdlib.h>