This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HookFx<T> where T : Delegate | |
{ | |
private readonly nint _original; | |
private readonly T _target; | |
private byte[] _originalByteCode = new byte[0]; | |
private bool isInstalled; | |
public HookFx(nint original, T target) | |
{ | |
_original = original; | |
_target = target; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System.Linq; | |
using System.IO; | |
public class CubemapTextureBuilder : EditorWindow | |
{ | |
[MenuItem("Tools/Cubemap Builder")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rarity = new [] { 5000, 2000, 1000, 500, 100 }; | |
int[] dispenser_action(int sum) | |
{ | |
if (sum % rarity.OrderBy(x => x).First() != 0) | |
throw new Exception(); | |
var result = new List<int>(); | |
foreach (var r in rarity) | |
{ | |
var x = (sum - (sum % r)) / r; | |
result.AddRange(Enumerable.Range(0, x).Select(_ => r)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum | |
{ | |
NOP, | |
ADD | |
}; | |
struct thestack { | |
union { | |
int i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#MaxThreadsPerHotkey 3 | |
F1:: | |
Toggle := !Toggle | |
Loop | |
{ | |
If (!Toggle) | |
Break | |
Click down | |
Sleep 850 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(?x) | |
(?<return-type> | |
(?<type-name> | |
(?: | |
(?:ref\s+(?:readonly\s+)?)? | |
(?: | |
(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\s*\:\:\s*)? | |
(?<name-and-type-args> | |
\g<identifier>\s* | |
(?<type-args>\s*<(?:[^<>]|\g<type-args>)+>\s*)? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#if defined(__GNUC__) || (defined(__ICC) && (__ICC >= 600)) | |
#define G_FUNCTION_NAME __PRETTY_FUNCTION__ | |
#elif defined(__FUNCSIG__) | |
#define G_FUNCTION_NAME __FUNCSIG__ | |
#elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) | |
#define G_FUNCTION_NAME __FUNCTION__ | |
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) | |
#define G_FUNCTION_NAME __func__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double Divide(BigInteger x, BigInteger y) | |
=> Math.Exp(BigInteger.Log(x) - BigInteger.Log(y)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Arduino.h" | |
#include "TM74.h" | |
#define DIO 5 | |
#define RCLK 6 | |
#define SCLK 7 | |
#define ALARM 10 | |
TM74 display(SCLK, RCLK, DIO); |