Skip to content

Instantly share code, notes, and snippets.

View JakubNei's full-sized avatar

Jakub Nei JakubNei

View GitHub Profile
@JakubNei
JakubNei / pbr.glsl
Created May 30, 2017 12:53 — forked from galek/pbr.glsl
PBR GLSL SHADER
in vec2 v_texcoord; // texture coords
in vec3 v_normal; // normal
in vec3 v_binormal; // binormal (for TBN basis calc)
in vec3 v_pos; // pixel view space position
out vec4 color;
layout(std140) uniform Transforms
{
mat4x4 world_matrix; // object's world position
@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 / 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 && e && f) {
@JakubNei
JakubNei / Prefix only issue.md
Last active December 11, 2017 20:23
Naming issue (Prefix only issue)

Prefix only issue

The general goal of your codebase should be to make it as easy to understand as possible.

Easy to understand results in:

  • less bugs due to insufficient knowledge (because over time you might forget some parts)
  • implicit understanding without the need for comments (less time spent reading comments)
  • no need for documentation or intruduction to the project, since it's faster to just look at the code
  • in case everyone dies, rookie can just come in and easily continue on
@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.

General way of working

Merge only working code.

If you are unsure, ask.

If you are stuck for over 1 hour, ask (anyone).

@JakubNei
JakubNei / DependencyAttribute.cs
Last active June 8, 2023 17:15
Beginnings of simple one dependency injection. For: https://github.com/aeroson/mcs-ICodeCompiler/issues/6
using System;
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class DependencyAttribute : Attribute
{
}
@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
// #define USE_VEXE_FAST_REFLECTION // download it at https://github.com/vexe/Fast.Reflection increases reflection invoke performance significantly
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Reflection;
#if USE_VEXE_FAST_REFLECTION
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using Ionic.Zip;