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 / Transform.cs
Last active June 29, 2016 07:32
What needs to be changed in Unity's Transform to implement IEnumerable<Transform> plus IList<Transform> GetChildren() method
public sealed class Transform : IEnumerable, IEnumerable<Transform>
{
private sealed class Enumerator : IEnumerator, IEnumerator<Transform>
{
private Transform outer;
private int currentIndex = -1;
object IEnumerator.Current
{
get
@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 / teso_algorithms_and_facts.md
Created January 14, 2017 12:18
The Elder Scrolls Online - algorithms & facts sheet

http://esoacademy.com/damage-in-eso/ https://www.reddit.com/r/elderscrollsonline/comments/3ov0n4/formulas_for_max_statsweaponspell_damage_etc/ http://elderscrollsonline.wiki.fextralife.com/Stats http://elderscrollsonline.wiki.fextralife.com/Mundus+Stones

The Restoration staff's basic attack is weak compared to the Destruction staff, but it has one critical advantage: its heavy attack restores 10% of your magicka. This makes the Resto staff the number one choice for magicka-focused characters, even if you don't plan to heal. It also has great survivability skills like Regeneration and Blessing of Protection.

@JakubNei
JakubNei / Refactoring the wrong way.md
Created January 27, 2017 14:21
Refactoring the wrong way
void main(...) {
  if(a && b && c) {
    code_1 - 400 lines
  }
 if(d &amp;&amp; e &amp;&amp; f) {
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using Ionic.Zip;
@JakubNei
JakubNei / dataTables_patch.js
Created April 27, 2017 08:48 — forked from krusynth/dataTables_patch.js
dataTables.js requires you to have "good" tables. If your table has an uneven number of columns per row, and you're getting the dreaded " Cannot read property 'mData' of undefined " this will fix it.
// dataTables.js is great! But it requires you to have "good" tables in
// the first place. If your table has an uneven number of columns per
// row, and you're getting the dreaded "Cannot read property
// 'mData' of undefined" this'll fix it. If you're missing a thead or
// tbody you'll get that error too - this won't fix that!
$(document).ready(function() {
// We need to make sure every row in our table has the same number of columns.
// Otherwise dataTable doesn't work.
$('table').each(function(i, elm) {
@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 / 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;

If user is able to type date in text, do show the date format somewhere, i.e.:

  • Start Date: <input type="text" name="start_date" placeholder="yyyy-MM-dd">
  • Start Date <small>yyy-MM-dd</small>: <input type="text" name="start_date">
  • Start Date: <input type="text" name="start_date" alt="yyy-MM-dd">
  • combination of (all) above