Skip to content

Instantly share code, notes, and snippets.

@mstum
mstum / Benchmark.txt
Last active April 17, 2023 15:02
Fully Managed alternative to StrCmpLogicalW
BenchmarkDotNet=v0.10.13, OS=Windows 10 Redstone 3 [1709, Fall Creators Update] (10.0.16299.309)
Intel Core i7-6700HQ CPU 2.60GHz (Skylake), 1 CPU, 8 logical cores and 4 physical cores
Frequency=2531253 Hz, Resolution=395.0613 ns, Timer=TSC
[Host] : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2633.0
Clr : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2633.0
Job=Clr Runtime=Clr
Method | Mean | Error | StdDev | Allocated |
---------------------------- |---------:|---------:|---------:|----------:|
@lazlo-bonin
lazlo-bonin / UndoUtility.cs
Last active June 17, 2024 12:51
Fixing Unity's broken Undo.RecordObject
using UnityEditor;
using UnityEngine;
using UnityObject = UnityEngine.Object;
namespace Ludiq
{
public static class UndoUtility
{
private static void RecordObject(UnityObject uo, string name)
{
@aromig
aromig / robocopy_exclude_existing_files.cmd
Created September 28, 2016 14:47
Robocopy - Exclude Existing Files
robocopy c:\Sourcepath c:\Destpath /E /XC /XN /XO
:: /E makes Robocopy recursively copy subdirectories, including empty ones.
:: /XC excludes existing files with the same timestamp, but different file sizes. Robocopy normally overwrites those.
:: /XN excludes existing files newer than the copy in the source directory. Robocopy normally overwrites those.
:: /XO excludes existing files older than the copy in the source directory. Robocopy normally overwrites those.
:: With the Changed, Older, and Newer classes excluded, Robocopy will exclude files existing in the destination directory.
@keithcollins
keithcollins / AStarSearch.cs
Created August 30, 2016 23:45
A* pathfinding implementation for Unity 5, C#
using UnityEngine;
using System.Collections.Generic;
using System.Collections;
// This script is adapted from these,
// but has been heavily modified in some areas:
// http://www.redblobgames.com/pathfinding/a-star/implementation.html#csharp
// https://gist.github.com/DanBrooker/1f8855367ae4add40792
// I'm continuing to optimize and change things here. I would not use this
@mikoim
mikoim / ginnan.js
Last active November 30, 2023 16:45
Remove sold out items from 夢ふうりん / Let's shopping!
Array.prototype.forEach.call(document.querySelectorAll('img[src$="../tsk/soldout.gif"], img[src$="soldout.gif"]'), function (el, i) {
el.closest('tr').remove();
});