Skip to content

Instantly share code, notes, and snippets.

View ForNeVeR's full-sized avatar
🦑

Friedrich von Never ForNeVeR

🦑
View GitHub Profile
@ForNeVeR
ForNeVeR / Diagnose-ChocolateyError.ps1
Created March 7, 2016 07:39
Search registry errors to fix them manually.
$local_key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
$machine_key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
$machine_key6432 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
$items = Get-ChildItem @($local_key, $machine_key, $machine_key6432)
$ErrorActionPreference = 'Stop'
foreach ($item in $items) {
Write-Output $item.PSPath
$null = Get-ItemProperty $item.PSPath
}
@ForNeVeR
ForNeVeR / main.cpp
Created February 14, 2014 14:32
"ЩИ!!!Симулятор жестокости" - http://www.gamedev.ru/projects/forum/?id=160897
#define WIN32_LEAN_AND_MEAN // just say no to MFC
#define INIT_GUID
#include "hge.h"
#include <hgesprite.h>
#include <hgefont.h>
#include <hgecolor.h>
using System;
using System.Reflection;
interface ILoveCats
{ }
class Program
{
static void Main(string[] args)
{
@ForNeVeR
ForNeVeR / CreateStaticClass.cs
Last active January 12, 2018 13:39
Static class creation test.
using System;
using System.Reflection;
class Program
{
static void Main(string[] args)
{
var allocate = typeof(RuntimeTypeHandle).GetMethod("Allocate", BindingFlags.NonPublic | BindingFlags.Static);
var math = allocate.Invoke(null, new[] { typeof (Math) });
@ForNeVeR
ForNeVeR / FalseSharing.cs
Last active February 21, 2020 10:11
False sharing test in C#.
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
namespace ConsoleApplication2
{
class Program
{
struct Fuck