Skip to content

Instantly share code, notes, and snippets.

@loimu
loimu / parse_cmake.cpp
Last active February 12, 2022 16:09
CMakeLists.txt parser, extracts a list of external dependencies (comparison between C++ and D implementations)
// parse_cmake.cpp - CMakeLists.txt parser, generates a list of dependencies
// Copyright (c) 2020 Blaze <blaze@vivaldi.net>
// Licensed under the GNU General Public License, version 3 or later.
// See the file http://www.gnu.org/copyleft/gpl.txt.
#include <fstream>
#include <regex>
#include <string>
#include <iostream>
#include <algorithm>
@loimu
loimu / range.d
Created March 11, 2020 11:32
IP Range Calculator written in D
// range.d - an example exercise in D lang
// Copyright (c) 2017 Blaze <blaze@vivaldi.net>
// Licensed under the GNU General Public License, version 3 or later.
// See the file http://www.gnu.org/copyleft/gpl.txt.
import std.stdio;
import std.conv;
import std.regex;
import std.string;
@loimu
loimu / qlogout.py
Created March 11, 2020 11:26
Simple Logout App for Openbox
#! /usr/bin/env python3
# Copyright (c) 2018 Blaze <blaze@vivaldi.net>
# Licensed under the GNU General Public License, version 3 or later.
# See the file http://www.gnu.org/copyleft/gpl.txt.
import sys
import subprocess
from PyQt5.QtCore import QSize, Qt, pyqtSlot
from PyQt5.QtGui import QIcon
@loimu
loimu / qcalendar.cpp
Last active March 11, 2020 11:46
Simple Calendar App
// qcalendar.cpp - Simple Calendar App written in C++
// Copyright (c) 2020 Blaze <blaze@vivaldi.net>
// Licensed under the GNU General Public License, version 3 or later.
// See the file http://www.gnu.org/copyleft/gpl.txt.
// Compile:
// g++ qcalendar.cpp -O2 -fPIC -std=c++17 -o qcalendar -lQt5Core -lQt5Gui -lQt5Widgets -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets
#include <vector>
#include <utility>
#include <QApplication>