Skip to content

Instantly share code, notes, and snippets.

View minorsecond's full-sized avatar

Robert Ross Wardrup minorsecond

View GitHub Profile
#include <QStandardPaths>
#include <sys/stat.h>
#include <sys/types.h>
QString GetConfPath() {
// Get configuration path for MacOS.
std::string directory = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).at(0).toStdString();
std::string conf_path = directory + "/QtTermTCP.ini";
mkdir(directory.c_str(), 0775);
@minorsecond
minorsecond / datesorter.cpp
Last active June 17, 2021 23:02
date sorter
bool Database::compare_date(const Drink &a, const Drink &b) {
/*
* Determine if second date is greater than the first date.
* @param a: Date from a struct in YYYY-MM-DD format
* @param b: Date from b struct in YYYY-MM-DD format
* @return: True if second date is more recent than the first date. Else, false.
*/
int a_year = std::stoi(a.date.substr(0, 4));
int a_month = std::stoi(a.date.substr(5, 7));
#############################################################
# #
# Configuration file for Dire Wolf #
# #
# Macintosh version #
# #
#############################################################
#
# Consult the User Guide for more details on configuration options.
#