Skip to content

Instantly share code, notes, and snippets.

View LiteApplication's full-sized avatar
🎓
Engineering School, here I am

Alexis Rossfelder LiteApplication

🎓
Engineering School, here I am
View GitHub Profile
@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>
@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'