Skip to content

Instantly share code, notes, and snippets.

View dfch's full-sized avatar

Ronald Rink dfch

View GitHub Profile
@dfch
dfch / Boxed.cs
Last active August 28, 2021 22:19
Converting ODataQueryOptions into LINQ Expressions in C#
/**
* Copyright 2017 d-fens GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dfch
dfch / ComRegistration.cs
Created August 21, 2019 12:33
Sparx Enterprise Architect Registration of ActiveX Controls under HKEY_CURRENT_USER
public class ComRegistration
{
private const string DEFAULT_VALUE = "";
private const char BACKSLASH = '\\';
private const string HKEY_SOFTWARE_CLASSES = @"SOFTWARE\Classes\";
private const string HKEY_SOFTWARE_WOW_CLSID = @"Software\Classes\WOW6432Node\CLSID\";
private const string IMPLEMENTED_CATEGORY_DOTNET = @"Implemented Categories\\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}";
private const string THREADING_MODEL = "ThreadingModel";
'=↓=↓=↓= MW3 Header Start =↓=↓=↓=↓=↓=↓=↓=↓=↓=↓=↓=↓=[MWTAG1]
' Script Type: MacroWorks 3 Device Script
' Device Name: X-keys XK-24
' Device Description: 24 Button HID Controller
' Script Name: XK-24
' Script Description: Macros for XK-24 [MWTAG19]
' PID: 1029
' Firmware: π3 V 28
' MW3 Version: 15
' Script Language: Visual Basic
@dfch
dfch / ### Sending Gelf messages to Graylog2 via PowerShell.md
Last active May 5, 2020 21:17
Sending Gelf messages to Graylog2 via PowerShell
@dfch
dfch / HubFactory.cs
Created March 17, 2017 23:11
Creating SignalR Hub Classes on the fly - http://d-fens.ch/2017/03/17/creating-signalr-hub-classes-on-the-fly/ - d-fens.ch
/**
* Copyright 2017 d-fens GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dfch
dfch / Get-Functions.ps1
Last active March 12, 2018 22:01
Enumerate all functions in a PowerShell script file via AST
#Requires -Version 3
# http://d-fens.ch/2015/04/26/nobrainer-enumerate-all-functions-in-a-powershell-script-file-via-ast
[CmdletBinding(
SupportsShouldProcess = $true
,
ConfirmImpact = 'Low'
,
DefaultParameterSetName = 'list'
)]
Param
@dfch
dfch / connection.cs
Last active May 8, 2017 01:04
Receiving SignalR messages from PowerShell
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Client;
using System.Collections.Concurrent;
using System.Net;
/**
* Copyright 2016 d-fens GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dfch
dfch / 00-README.md
Last active February 27, 2016 17:30
ODataQueryOptions do not apply $filter and $orderby options to IQueryable when using EntityFramework 6 with SQL Server