Skip to content

Instantly share code, notes, and snippets.

View cfHxqA's full-sized avatar

cfHxqA cfHxqA

View GitHub Profile
@cfHxqA
cfHxqA / chat-gpt-cleaner.user.js
Last active July 23, 2025 18:12
Automatically cleans chat history and workspace logs. Supports regex-based search to selectively target and delete specific chats. Ideal for maintaining a tidy communication environment with custom cleanup rules.
// ==UserScript==
// @name chat-gpt-cleaner
// @version 1.0.0.0
//
// @author cfHxqA
// @copyright 2024 - 2025 (C) cfHxqA
//
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.min.js
//
@cfHxqA
cfHxqA / RestClientUtil.cs
Last active January 2, 2023 18:18
This class adds some extension functions to reflect download progress and to download files in chunks.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
/**
* @author cfHxqA
@cfHxqA
cfHxqA / ParallelQueueItem.cs
Last active March 8, 2022 19:03
A class for running a queue in parallel - synchronous and asynchronous supported.
using System.Collections.Concurrent;
using System.Threading.Channels;
using System.Threading.Tasks.Dataflow;
/**
* @author cfHxqA
* @copyright 2019-2022 (C) by cfHxqA
*
* @package System.Collections.Generic
* @category Utilities
*
@cfHxqA
cfHxqA / OnSingletonContstraint.cs
Created June 14, 2020 08:37
A PostSharp attribute to create a singleton instance of a class. The instance of the class can be called using the $Class.GetInstance() method.
using PostSharp.Extensibility;
using System;
using System.Linq;
using System.Reflection;
/**
* @author cfHxqA
* @copyright 2013 - 2020 (C) by cfHxqA
*
* @package PostSharp
@cfHxqA
cfHxqA / ConcurrentList.cs
Last active December 17, 2020 18:33
Thread-Safe Collection with reader-/writer synchronizen, based on PostSharp.
using PostSharp.Patterns.Model;
using PostSharp.Patterns.Threading;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Linq.Expressions;
/**
* @author cfHxqA
* @copyright 2019-2020 (C) by cfHxqA
@cfHxqA
cfHxqA / OnClassBoundaryConstraint.cs
Last active June 19, 2020 15:02
This condition can be used to set a naming scheme for the respective class. The 'NamingConventionAttribute' attribute is the same as this class. However, this attribute derives from the exact name of the class, regardless of generic type, etc.
using PostSharp.Extensibility;
using System;
using System.Text.RegularExpressions;
/**
* @author cfHxqA
* @copyright 2013 - 2020 (C) by cfHxqA
*
* @package PostSharp
* @category PostSharp.Constraints
@cfHxqA
cfHxqA / Example.cs
Last active March 4, 2020 06:52
A small implementation for „magic“ getters / setters who are thread safe.
using System.Collections.Concurrent;
using System.Collections.Generic;
namespace Hello {
class World : IPropertyIndexed<string, object> {
#region Public
#region Methods
public void Sample() {
Console.WriteLine($"Is 'hello' null? Result: {(this["hello"] is null)}");
@cfHxqA
cfHxqA / AbstractModel.cs
Last active August 30, 2019 21:36
A small part of my Model-/ViewModel classes, which I have prepared for some projects and work wonderfully in WinForms-/WPF projects. Incidentally, the classes are needed for the MVVM-Pattern. The View class I do not provide, which explains itself by itself. ;-)
using PostSharp;
using PostSharp.Patterns.Model;
using System;
using System.ComponentModel;
/**
* @author cfHxqA
* @copyright 2019 (C) by cfHxqA
*
* @package Sample
@cfHxqA
cfHxqA / JsonConverterPropertyPath.cs
Last active February 25, 2020 20:46
The class serializes and deserializes the property with the dot to the respective level, with creating the associated objects.
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
/**
@cfHxqA
cfHxqA / App.config
Created August 4, 2019 14:29
A small „default configuration“ for the App.config. It helps to integrate the libraries from different directories.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<loadFromRemoteSources enabled="true" />
<relativeBindForResources enabled="true" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="FolderA;FolderB" />