Skip to content

Instantly share code, notes, and snippets.

@Rolias
Rolias / PropertyHelper.h
Last active September 27, 2023 21:58
Qt Auto Property Macros
#pragma once
#include <QObject>
//See Gist Comment for description, usage, warnings and license information
#define AUTO_PROPERTY(TYPE, NAME) \
Q_PROPERTY(TYPE NAME READ NAME WRITE NAME NOTIFY NAME ## Changed ) \
public: \
TYPE NAME() const { return a_ ## NAME ; } \
void NAME(TYPE value) { \
if (a_ ## NAME == value) return; \
a_ ## NAME = value; \
@antonl
antonl / simple.cpp
Last active June 22, 2018 14:49
Qt Threads and StateMachine
#include <QObject>
#include <QState>
#include <QStateMachine>
#include <QThread>
#include <QApplication>
#include <QDebug>
#include <QTimer>
// Worker Object
class Worker : public QStateMachine
@drewmoseley
drewmoseley / yocto-mender-rpi3.sh
Last active June 8, 2022 13:44
Script to build Yocto+Mender for Raspberry Pi 3
#!/bin/bash
#
if [ "$(/bin/ls -1A | wc -l)" -ne "0" ]; then
echo Please run this from an empty directory.
exit 1
fi
BASE=$(pwd -P)
@loganvolkers
loganvolkers / Byte Formatting for Google Sheets.md
Last active June 21, 2024 21:59
Byte formatting for Google Sheets
<?php
namespace App;
use Illuminate\Support\Facades\DB;
class CreateLaravelHypertable
{
@zhmu
zhmu / magic_enum_reduced.h
Created February 12, 2023 11:07
Simpler magic_enum which only implements enum_to_string()
// SPDX-License-Identifier: MIT
// Copyright (c) 2023 Rink Springer <rink@rink.nu>
//
// Based on https://github.com/Neargye/magic_enum/blob/master/include/magic_enum.hpp
// Copyright (c) 2019 - 2022 Daniil Goncharov <neargye@gmail.com>.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell