Skip to content

Instantly share code, notes, and snippets.

View sylveon's full-sized avatar

Charles Milette sylveon

View GitHub Profile
@sylveon
sylveon / SColour.hpp
Created June 9, 2018 20:41
VSCode C++ bug
#pragma once
#include <algorithm>
#include <cstdint>
struct SColour {
// Red, green and blue
uint8_t r, g, b;
// Hue, saturation and value
using FirstFloor.ModernUI.Windows.Controls;
using Microsoft.Win32;
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using BitmapToBase64;
using FirstFloor.ModernUI.Windows.Controls;
using Microsoft.Win32;
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Web;
using System.Windows;
using System.Windows.Controls;
#include <string>
#include <windows.h>
#include "swcadef.h"
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
std::wstring className;
className.resize(257); // According to docs, maximum length of a class name is 256, but it's ambiguous
// wether this includes the null terminator or not.
@sylveon
sylveon / a.cpp
Last active February 28, 2019 05:06
Roast me
namespace impl {
constexpr bool IsDecimalDigit(wchar_t character)
{
return character >= L'0' && character <= L'9';
}
constexpr bool IsCapitalHexDigit(wchar_t character)
{
return character >= L'A' && character <= L'F';
}
#include <string>
#include <tuple>
#include <utility>
template<typename T, typename U>
constexpr auto operator ,(T&& a, U&& b)
{
return std::make_tuple(std::forward<T>(a), std::forward<U>(b));
}
@sylveon
sylveon / filesystem-string_view-proposal.md
Last active May 28, 2019 20:35
Improving interoperability between std::filesystem::path and std::string_view

Improving interoperability between std::filesystem::path and std::string_view

Document number: D0000R0
Date: 2019-05-28
Project: WG21, Library Working Group
Author: Charles Milette charles.milette@gmail.com

1. Introduction

This proposal allows assigning a type convertible to a std::string_view to a std::filesystem::path.

#pragma once
#include "arch.h"
#include <dwmapi.h>
#include <functional>
#include <string>
#include <windef.h>
#include <winuser.h>
#ifdef _TRANSLUCENTTB_EXE
#include <filesystem>
#include <cstddef>
#include <filesystem>
#include <iostream>
#include <memory>
#include <Shlobj.h>
#include <string>
#include <winver.h>
#include <wil/resource.h>
#include "version.hpp"

Keybase proof

I hereby claim:

  • I am sylveon on github.
  • I am sylve0n (https://keybase.io/sylve0n) on keybase.
  • I have a public key whose fingerprint is 5664 9C67 BEBE 739F 8A2E C319 1A5A E813 77AD 973A

To claim this, I am signing this object: