Skip to content

Instantly share code, notes, and snippets.

View JakubNei's full-sized avatar

Jakub Nei JakubNei

View GitHub Profile
@JakubNei
JakubNei / php db query result to JSON
Created March 29, 2014 09:41
a simple php code that will parse any db query into JSON
/*
=================================================
===================== INFO ======================
=================================================
Here is my useful mysql to json code:
mysql tip:
select "|"tour
@JakubNei
JakubNei / Occlusion.Area.cs
Last active September 25, 2020 15:34
Lame Implementation of Area and Portal Occlusion Culling based on DOOM 3 BFG http://www.iddevnet.com/doom3/visportals.php https://github.com/id-Software/DOOM-3-BFG
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Extensions;
namespace Occlusion
{
public class Area : MonoBehaviour
{
//
// Mono.CSharp CSharpCodeCompiler Class implementation
//
// Authors:
// Sean Kasun ([email protected])
// Gonzalo Paniagua Javier ([email protected])
//
// Copyright (c) Novell, Inc. (http://www.novell.com)
//
@JakubNei
JakubNei / start_server.exe.config
Last active June 29, 2016 07:34
Arma 3 game dedicated server utility is used to start server, to automatically set -mod folders and -port, you can configure it in config file, all [varName] is replaced with contents of matching <varName></varName>, replacing is done in few iterations to propagate dependencies, has two inbuild variables: [port] is taken from the containing fold…
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!--
this utility is used to start server, to automatically set -mod folders and -port
this utility was designed to be right next to the <executable>
you can configure it in this config file, all [varName] is replaced with contents of matching <varName></varName>
replacing is done in few iterations to propagate dependencies
has two inbuild variables
@JakubNei
JakubNei / DeferredSynchronizeInvoke.cs
Last active January 11, 2023 11:06
Implementation of ISynchronizeInvoke for Unity3D game engine. Can be used to invoke anything on main Unity thread. ISynchronizeInvoke is used extensively in .NET forms, it's is elegant and quite useful in Unity as well. I implemented it so i can use it with System.IO.FileSystemWatcher.SynchronizingObject.
/*
Implementation of ISynchronizeInvoke for Unity3D game engine.
Can be used to invoke anything on main Unity thread.
ISynchronizeInvoke is used extensively in .NET forms, it's is elegant and quite useful in Unity as well.
I implemented it so i can use it with System.IO.FileSystemWatcher.SynchronizingObject.
help from: http://www.codeproject.com/Articles/12082/A-DelegateQueue-Class
example usage: https://gist.github.com/aeroson/90bf21be3fdc4829e631
version: aeroson 2017-07-13 (author yyyy-MM-dd)
@JakubNei
JakubNei / NamespaceNode.cs
Last active June 10, 2017 06:48
Simple class to gather and iterate over all namespaces in all AppDomain.CurrentDomain.GetAssemblies(). It builds a tree of NamespaceNode. To generate it and to get root use NamespaceNode.Root.
/*
Simple class to gather and iterate over all namespaces in all AppDomain.CurrentDomain.GetAssemblies().
It builds a tree of NamespaceNode.
To generate it and to get root use NamespaceNode.Root.
license: WTFPL (http://www.wtfpl.net/)
author: aeroson
*/
using System;
@JakubNei
JakubNei / ComponentsCopier.cs
Last active January 31, 2023 05:41
A simple little editor extension to copy and paste all components
/*
A simple little editor extension to copy and paste all components
Help from http://answers.unity3d.com/questions/541045/copy-all-components-from-one-character-to-another.html
license: WTFPL (http://www.wtfpl.net/)
author: aeroson
*/
using UnityEngine;
using UnityEditor;
@JakubNei
JakubNei / ObjectPooler.cs
Last active June 10, 2017 06:48
Simple generic object pooler, mostly useful for Unity. Example usages shows some Unity specific use cases. Entries are created (createObj) as needed with GetNext method. Then once they run out of live they are set to dead (setDeadObj). If they are dead for timeToDestroyOnceDead seconds they are destroyed (destroyObj). If they are needed again b…
/*
Simple generic object pooler, mostly useful for Unity.
Example usages shows some Unity specific use cases.
Entries are created (createObj) as needed with GetNext method.
Then once they run out of live they are set to dead (setDeadObj).
If they are dead for timeToDestroyOnceDead seconds they are destroyed (destroyObj).
If they are needed again before their timeToDestroyOnceDead timer runs out they are set alive (setAliveObj).
license: WTFPL (http://www.wtfpl.net/)
author: aeroson
@JakubNei
JakubNei / BaseObject.cs
Created September 19, 2015 14:01
My fancy custom UnityEngine.Transform like setup. Sorry, i just love doing stupid things like this.
/// <summary>
/// Implements basic equals methods and bool converions, similar to UnityEngine.Object
/// </summary>
public class BaseObject
{
public override bool Equals(object obj)
{
return AreObjectsEqual(this, obj as BaseObject);
}
public override int GetHashCode()
@JakubNei
JakubNei / MyQuaternion.cs
Last active June 8, 2023 17:14
A custom completely managed implementation of UnityEngine.Quaternion. Base is decompiled UnityEngine.Quaternion. Doesn't implement methods marked Obsolete. Does implicit coversions to and from UnityEngine.Quaternion
using System;
using UnityEngine.Internal;
using UnityEngine;
using System.Runtime.Serialization;
using System.Xml.Serialization;
/// <summary>
/// Quaternions are used to represent rotations.
/// A custom completely managed implementation of UnityEngine.Quaternion
/// Base is decompiled UnityEngine.Quaternion