Skip to content

Instantly share code, notes, and snippets.

@stdexception
stdexception / beforescriptexecute-polyfill.js
Created September 3, 2025 01:38 — forked from x0a/beforescriptexecute-polyfill.js
Lightweight beforescriptexecute / onbeforescriptexecute polyfill
(function(){
if("onbeforescriptexecute" in document) return; // Already natively supported
let scriptWatcher = new MutationObserver(mutations => {
for(let mutation of mutations){
for(let node of mutation.addedNodes){
if(node.tagName === "SCRIPT"){
let syntheticEvent = new CustomEvent("beforescriptexecute", {
detail: node,
cancelable: true
@stdexception
stdexception / LowUtilities.cpp
Created June 20, 2025 06:48 — forked from D4stiny/LowUtilities.cpp
A dependency-less implementation of GetModuleHandle and GetProcAddress.
//
// An implementation of GetModuleHandle and GetProcAddress that works with manually mapped modules, forwarded exports,
// without a CRT standard library, and uses no Windows API or dependencies.
//
// Author: Bill Demirkapi
// License: MIT, appended at the bottom of this document if you care about licensing and want to credit me in your own project.
//
#include <Windows.h>
#include <winternl.h>
@stdexception
stdexception / get_proc_address.c
Created June 20, 2025 06:48 — forked from OtterHacker/get_proc_address.c
Custom GetProcAddress and GetModuleHandle parsing forwarded export
unsigned long hash_string(void* buffer, unsigned long size, char* extension){
unsigned char current = 0;
unsigned long hash = 0;
unsigned char* currentChar = NULL;
hash = 1337;
currentChar = (void*)buffer;
hash++;
while(1){
current = *currentChar;
@stdexception
stdexception / frameless.cpp
Created March 8, 2025 02:17 — forked from Nico-Duduf/frameless.cpp
Qt - Resizable frameless widget
#include "frameless.h"
FrameLess::FrameLess(QWidget *target) :
_target(target),
_cursorchanged(false),
_leftButtonPressed(false),
_borderWidth(5),
_dragPos(QPoint())
{
_target->setMouseTracking(true);
@stdexception
stdexception / Qt 5 Dark Fusion Palette
Created October 23, 2023 03:12 — forked from QuantumCD/Qt 5 Dark Fusion Palette
This is a complete (I think) dark color palette for the Qt 5 Fusion theme, as well as a nice style sheet for the tool tips that make them blend better with the rest of the theme. To have immediate effect, be sure to put this in your main function before showing the parent window. Child windows should automatically inherit the palette unless you …
qApp->setStyle(QStyleFactory::create("Fusion"));
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, QColor(53,53,53));
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, QColor(25,25,25));
darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53));
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
@stdexception
stdexception / qcheckcombobox.py
Created June 20, 2023 09:45 — forked from ales-erjavec/qcheckcombobox.py
A QComboBox supporting multiple item selection
"""
Check Combo Box
---------------
A QComboBox subclass designed for multiple item selection.
The combo box popup allows the user to check/uncheck multiple items at
once.
"""
@stdexception
stdexception / HtmlDelegate.cpp
Last active June 15, 2023 05:33
Qt HtmlDelegate for RichText display
class HtmlDelegate : public QStyledItemDelegate
{
protected:
void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const;
};
void HtmlDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionViewItem option = option;
@stdexception
stdexception / OutlookDataObject.cs
Created January 29, 2023 10:32 — forked from MattyBoy4444/OutlookDataObject.cs
Fixed issue with exception attempting to access protected memory
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Reflection;
using System.IO;
using System.Windows;

Why I think Immediate Mode GUI is way to go for GameDev tools

Prerequisites

Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
// adapted code from http://www.codeproject.com/Tips/1116253/Desktop-Screen-Capture-on-Windows-via-Windows-Desk
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <shlobj.h>
#include <shellapi.h>
#include <dxgi1_2.h>
#include <d3d11.h>
#include <memory>