This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A small script to fix the datetime of jpg files in a directory. | |
It copies the exif datetime to the file's mtime and vice versa. | |
This can fix various importing issues with photo management software (e.g. Google photos). | |
NOTE: This script uses the piexif library to read and write exif data, you will need to install it. | |
NOTE 2: This script will overwrite the mtime of the files. If you use the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_COPY_TRAITS | |
#define UT_COPY_TRAITS | |
#if __cplusplus < 202'002L | |
# error this file has to be compiled with at least C++20 | |
#endif | |
/** | |
* Usage: | |
* std >= c++20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---Inspect a value | |
--- | |
---Converts nil, boolean, number, string or table to string | |
---Any other type is converted with `tostring`. | |
--- | |
---List-like tables are printed without their indices | |
--- | |
---Usage: | |
--- | |
---```lua |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def typecheck( | |
func=None, | |
*, | |
check_return=False, | |
): | |
""" | |
Perform a runtime type check of the function arguments and (optionally) its | |
return type. | |
All annotated arguments and keyword arguments will be typechecked. Known |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_ASSERT_ | |
#define UT_ASSERT_ | |
#if __cplusplus < 202'002L | |
# error this file has to be compiled with at least C++20 | |
#endif | |
/** Usage: | |
* std >= C++20 (C++23) | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_TRIM | |
#define UT_TRIM | |
#if __cplusplus < 202'002L | |
# error this file has to be compiled with at least C++20 | |
#endif | |
/** Usage: | |
* std >= C++20 | |
* Simple string_stream trimming (trims whitespace by default) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extract speaker notes (with related headings) from a pandoc markdown document | |
# Produces valid markdown which can be compiled with pandoc | |
# Headings are also separated by hrules | |
# Example usage: | |
# awk -f get_notes.awk your_source.md | pandoc -f markdown -o your_notes.pdf | |
## Find the closing div for the notes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_PAIR_HPP | |
#define UT_PAIR_HPP | |
#if __cplusplus < 202'002L | |
# error this file has to be compiled with at least C++20 | |
#endif | |
// A std::pair replacement with no implicit (or any!) constructors. | |
// All conversions are done through either member functions or static functions | |
// Also you can use it in a range-based-for loop if the types of `first` and `second` are the same |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_REALLOC_UNIQUE_PTR_HPP | |
#define UT_REALLOC_UNIQUE_PTR_HPP | |
#include <memory> | |
#include <utility> | |
#if __cplusplus < 201'703L | |
# error this file has to be compiled with at least C++17 | |
#endif | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef UT_SV_TO_NUM_HPP | |
#define UT_SV_TO_NUM_HPP | |
#include <charconv> | |
#include <concepts> | |
#include <optional> | |
#include <string_view> | |
#if __cplusplus < 202002L | |
#error this file has to be compiled with at least C++20 | |
#endif |