Skip to content

Instantly share code, notes, and snippets.

View vbaderks's full-sized avatar

Victor Derks vbaderks

  • Nijmegen, The Netherlands
  • 22:01 (UTC +02:00)
View GitHub Profile
@nathancorvussolis
nathancorvussolis / wix-v4-bootstrap-download-vcredist-sample.wxs
Last active January 13, 2024 18:33
WiX v4 - Visual C++ 2015-2022 Redistributable - 14.38.33130
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Bundle
Name="Example Product"
Version="1.2.3.4"
Manufacturer="John Doe"
Copyright="© 2023 John Doe"
AboutUrl="https://example.net/"
@seanmiddleditch
seanmiddleditch / cplusplus-enum-members.md
Last active March 28, 2024 01:43
Meta-Proposal for Enum Member Functions

Meta-Proposal for Enum Member Functions

Problem

Enums today cannot provide any custom behavior via member functions. Behavior for enumeration types must be provided by traits classes or namespace-scope operator overloads and functions.

For some uses of enums, such as opaque ID wrapper or flags types, the inability to introduce hidden friend functions poisons the namespace scope of the enum (resulting in worse diagnostic and build times). Typically, custom operations and extension points should be defined as hidden friends to improve the experience of C++ developers using the type.

Consider:

@mikestecker
mikestecker / optimising-unifi-performance.md
Last active April 22, 2024 13:32
optimising-unifi-performance

optimising-unifi-performance

NOTE: Content below is written by Adrian Mace. Click here for an updated version.

Below are the key settings that I apply on any unifi installation for optimal performance.

Settings

Settings > Site

  • Ensure Enable Advanced Features is enabled
    This allows you to follow along with the guide in it's entirety.
@jtbr
jtbr / endianness.h
Last active February 13, 2024 08:36
cross-platform / cross-compiler standalone endianness conversion
/**
* @file endianness.h
* @brief Convert Endianness of shorts, longs, long longs, regardless of architecture/OS
*
* Defines (without pulling in platform-specific network include headers):
* bswap16, bswap32, bswap64, ntoh16, hton16, ntoh32 hton32, ntoh64, hton64
*
* Should support linux / macos / solaris / windows.
* Supports GCC (on any platform, including embedded), MSVC2015, and clang,
* and should support intel, solaris, and ibm compilers as well.
@BrukerJWD
BrukerJWD / iwyu.ps1
Created November 8, 2016 05:58
Wrapper for include-what-you-use which inspects all cpps
param(
[string]$Dir = ".",
[string]$Filter = "*.cpp"
)
$ErrorActionPreference = "Stop"
$iwyu = "\path\to\bin\include-what-you-use.exe"
@vurdalakov
vurdalakov / strings.h
Created September 30, 2016 02:26
std::string to std::wstring conversion (and vice versa) using Windows API
#pragma once
#include <windows.h>
#include <string>
inline std::wstring multi2wide(const std::string& str, UINT codePage = CP_THREAD_ACP)
{
if (str.empty())
{
return std::wstring();
@rodneyrehm
rodneyrehm / gist:40e7946c0cff68a31cea
Last active November 7, 2022 09:11
Diagrams for Documentation

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@zdeslav
zdeslav / ATLCPImplMT.hpp
Last active June 23, 2018 10:14
IConnectionPoint implementation with multithreading support for ATL projects. It marshals the client interfaces to the sender thread via GIT. Based on Microsoft KB article 280512
// This is a supplement to the Active Template Library 3.0.
// Copyright (C) 2000 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended for illustration.
#ifndef __CPIMPLMT_H__
#define __CPIMPLMT_H__
#include <atlcom.h>