Skip to content

Instantly share code, notes, and snippets.

View KillerGoldFisch's full-sized avatar

Kevin Gliewe KillerGoldFisch

View GitHub Profile
#!/usr/bin/env python
class Tools(object):
def __init__(self):
pass
def createDir(self, path):
'''
Creates the specified directory if not exists.
@KillerGoldFisch
KillerGoldFisch / GitRevertWhitespaceChanges.csx
Last active November 4, 2020 18:05
Reverts all file chenges witch only whitespace changes in a repo
#r "nuget:GCore/1.1.2.42"
#r "nuget:LibGit2Sharp/0.26.2"
using System;
using System.IO;
using System.Linq;
using GCore.Extensions.StringShEx;
using LibGit2Sharp;
var repoPath = @"D:\prog\repo";
// Example program
#include <iostream>
#include <string>
const char* iterationLabels[] = {
"Iteration 0", "Iteration 1", "Iteration 2", "Iteration 3", "Iteration 4", "Iteration 5", "Iteration 6", "Iteration 7", "Iteration 8", "Iteration 9", "Iteration 10", "Iteration 11", "Iteration 12", "Iteration 13", "Iteration 14", "Iteration 15", "Iteration 16", "Iteration 17", "Iteration 18", "Iteration 19", "Iteration ..."
};
template<typename T, int N>
int ArraySize(T(&)[N])
#include "cfprintf.h"
#ifdef _WIN32
#include <windows.h>
static HANDLE hConsole = 0;
#define BACK_TO_DEFAULT (15)
#else
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
@echo off
pwsh "%~dp0\Kill-ShaderTools.LanguageServer.ps1" %*
exit /b 0
@KillerGoldFisch
KillerGoldFisch / elevated.bat
Created May 12, 2020 14:49
This will automatically elevate using the standard UAC prompt. https://sites.google.com/site/eneerge/scripts/batchgotadmin
@echo off
:: BatchGotAdmin
::-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
@KillerGoldFisch
KillerGoldFisch / README.md
Created March 27, 2020 03:52 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@KillerGoldFisch
KillerGoldFisch / dbg.h
Created March 9, 2020 10:36 — forked from rioki/dbg.h
Debug Helpers
//
// Debug Helpers
//
// Copyright (c) 2015 - 2017 Sean Farrell <sean.farrell@rioki.org>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@KillerGoldFisch
KillerGoldFisch / Ex.t4
Created November 28, 2018 15:33
T4 template for executing a command
<#@ assembly name="System.dll" #>
<#@ import namespace="System" #>
<#@ import namespace="System.Diagnostics" #>
<#@ import namespace="System.Runtime.InteropServices" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#+
public string Ex(string cmd) {
var escapedArgs = cmd.Replace("\"", "\\\"");
@KillerGoldFisch
KillerGoldFisch / MQTTnetExtensions.cs
Created October 11, 2018 14:51
Server extensions for https://github.com/chkr1011/MQTTnet, exposes the session manager and sessions via reflection. Remember to lock the session dictionary before using it!!
using MQTTnet.Server;
using System;
using System.Collections.Generic;
using System.Reflection;
namespace MQTTnet.Server.Extensions
{
public static class MQTTnetExtensions
{
private static FieldInfo MqttClientSessionsManager_FI = typeof(MqttServer).GetField("_clientSessionsManager", BindingFlags.Instance | BindingFlags.NonPublic);