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 Python.Runtime; | |
PythonEngine.Initialize(); | |
using var _ = Py.GIL(); | |
var np = Py.Import("numpy"); | |
var polyfit = np.polyfit; | |
var poly1d = np.poly1d; |
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
internal interface IObserverLinkedList<T> | |
{ | |
void UnsubscribeNode(ObserverNode<T> node); | |
} | |
internal sealed class ObserverNode<T> : IObserver<T>, IDisposable | |
{ | |
private readonly IObserver<T> observer; | |
private IObserverLinkedList<T> list; |
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
if ping -c 1 10.10.10.254 &> /dev/null | |
then | |
if [ ! -f /tmp/cpu.up.status ]; then | |
cpupower frequency-set -u 3200Mhz | |
touch /tmp/cpu.up.status | |
if [ -f /tmp/cpu.down.status ]; then | |
rm -rf /tmp/cpu.down.status | |
fi | |
fi | |
else |
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 static class EnumCache<T> | |
{ | |
public class Cache<X> | |
{ | |
public Array Values { get; } | |
public object[] UnderlyingValues { get; } | |
public int TotalValues { get; } | |
public Type UnderlyingType { get; } | |
public Type SelfType => typeof(X); |
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; | |
using System.Collections.Generic; | |
using System.Runtime.CompilerServices; | |
using Unity.Burst; | |
using Unity.Collections; | |
using Unity.Mathematics; | |
using UnityEngine; | |
public unsafe class FluidSystem : IFluidSystem, IDisposable | |
{ |
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
# dec/14/2022 04:17:05 by RouterOS 7.7rc1 | |
# software id = XH5D-E1DZ | |
# | |
# model = RB2011UiAS-2HnD | |
# serial number = HCN087QV7D1 | |
/interface bridge add admin-mac=18:FD:74:20:D9:C2 auto-mac=no comment=defconf name=bridge | |
/interface wireless set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX disabled=no distance=indoors frequency=auto installation=indoor mode=ap-bridge ssid="BlackBox 2G" wireless-protocol=802.11 | |
/interface list add comment=defconf name=WAN | |
/interface list add comment=defconf name=LAN | |
/interface wireless security-profiles set [ find default=yes ] authentication-types=wpa2-psk mode=dynamic-keys supplicant-identity=MikroTik |
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 void Generate(Vector3 localUp = Vector3.up) | |
{ | |
var axisA = new Vector3(localUp.y, localUp.z, localUp.x); | |
var axisB = Vector3.Cross(localUp, axisA); | |
for (var y = 0; y < Resolution; y++) | |
for (var x = 0; x < Resolution; x++) | |
{ | |
var percent = new Vector2(x, y) / (Resolution - 1); | |
var pointOnUnitCube = localUp + (percent.x - .5f) * 2 * axisA + (percent.y - .5f) * 2 * axisB; |
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.ComponentModel; | |
using static NativeApi; | |
public class SplashScreen : IDisposable | |
{ | |
private ushort _wndClass; | |
private IntPtr _hwnd; | |
private const string CLASS_NAME = "SplashScreen"; | |
private Bitmap _bitmap; | |
private static HandleRef nullHandle = new HandleRef(null, IntPtr.Zero); | |
private WndProc? proc; |
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")] |
NewerOlder