Skip to content

Instantly share code, notes, and snippets.

View danieloneill's full-sized avatar

Daniel O'Neill danieloneill

View GitHub Profile
@danieloneill
danieloneill / proton-patch-skf4sevr-dlls_ntdll_loader_c.diff
Created January 7, 2023 03:05
Patch for Proton (wine/dlls/ntdll/loader.c) to allow SKSEVR/F4SEVR to load correctly.
*** loader.c.orig 2023-01-04 01:40:00.048623579 -0800
--- loader.c 2023-01-04 04:16:01.124146104 -0800
*************** static NTSTATUS load_native_dll( LPCWSTR
*** 2604,2611 ****
{
void *module = NULL;
SIZE_T len = 0;
NTSTATUS status = NtMapViewOfSection( mapping, NtCurrentProcess(), &module, 0, 0, NULL, &len,
! ViewShare, 0, PAGE_EXECUTE_READ );
@danieloneill
danieloneill / MCalendar.qml
Created November 11, 2022 13:29
Calendar, date range selector in Qt Quick/QML (Qt 6+) - https://imgur.com/QNYaR4h
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick.Layouts
ColumnLayout {
id: calendar
property alias day: gridMonth.selectedDay
property alias month: comboMonth.currentIndex
property alias year: spinYear.value
import QtQuick 2.4
Item {
id: scrollbar
property QtObject target //< The flickable to control
property bool autoHide: true //< If true, the bar will be hidden unless mouseover or moving
property real visibleOpacity: 0.9 //< When visible (not hidden), how "opaque" are we?
property int orientation: Qt.Vertical //< Either Qt.Vertical or Qt.Horizontal
@danieloneill
danieloneill / MSplitView.qml
Created May 26, 2022 00:25
SplitView in pure QML (Qt Quick) [https://streamable.com/6ncn98]
import QtQuick
Item {
id: splitView
property real minWidth: 10
signal manuallyResized()
// The rest is internal:
property variant componentList: []
@danieloneill
danieloneill / MButton.qml
Last active May 11, 2022 17:50
Pure QML Scrollbars for Qt Quick Flickable (https://streamable.com/nhxtci)
import QtQuick // No versioning in Qt6. For Qt5 put some version here.
Rectangle {
property alias text: label.text
property alias image: image
property bool checkable: false
property bool checked: false
signal clicked()
implicitWidth: label.text.length > 0 ? label.implicitWidth + 12 : 28
@danieloneill
danieloneill / QMLWasmSettings.cpp
Last active June 22, 2022 02:29
QSettings-ish WASM interface via Emscripten using EM_JS with invokable interface for QML (et al)
#include "wasm.h"
#include <QDebug>
#include <QByteArray>
#include <QDataStream>
#include <QIODevice>
#include <emscripten.h>
@danieloneill
danieloneill / QmlWasmLocation.cpp
Last active June 22, 2022 02:30
Getting window location (URL) and query items in Qt (via webassembly)
#include "wasm.h"
#include <QUrlQuery>
#include <QPair>
#include <emscripten.h>
EM_JS(char*, __js_location, (void), {
var locstr = window.location.href;
var len = lengthBytesUTF16(locstr) + 1;
@danieloneill
danieloneill / XPBar.qml
Last active May 24, 2022 15:41
Animated XP bar in QtQuick/QML [https://streamable.com/4zxtwh]
import QtQuick 2.15
import Qt5Compat.GraphicalEffects
RectangularGlow {
id: glowBox
cornerRadius: 5
color: 'black'
glowRadius: 5
spread: 0.0
@danieloneill
danieloneill / obs_studio-arm.diff
Created November 7, 2019 05:51
Patches for OBS Studio
diff --git a/deps/media-playback/CMakeLists.txt b/deps/media-playback/CMakeLists.txt
index d58d121..ae938fa 100644
--- a/deps/media-playback/CMakeLists.txt
+++ b/deps/media-playback/CMakeLists.txt
@@ -28,6 +28,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64le")
PUBLIC
-mvsx)
add_compile_definitions(NO_WARN_X86_INTRINSICS)
+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|aarch).*")
elseif(NOT MSVC)
@danieloneill
danieloneill / image2pdf_thermal_receipt.c
Created May 7, 2019 08:26
Convert input "image" in any format GraphicsMagick supports into PDF, resized and monochrome, to be printed on a thermal printer (such as a CT-S310II) via CUPS.
#include <magick/api.h>
/* Convert input "image" in any format GraphicsMagick supports into PDF, resized and monochrome,
* to be printed on a thermal printer (such as a CT-S310II) via CUPS.
*
* OrderedDitherImage seems to leak memory, according to Valgrind.
*
* Message me on Github if you know how to fix this? It's roughly 500 bytes per iteration on my tests.
*/
int image2pdf( int width, double dpi, const char *indata, size_t inlen, char **outdata, size_t *outlen )