Skip to content

Instantly share code, notes, and snippets.

View IlyaGutnikov's full-sized avatar

Ilya Gutnikov IlyaGutnikov

  • Moscow, Russian Federation
View GitHub Profile
@IlyaGutnikov
IlyaGutnikov / Log.cs
Created September 11, 2017 20:16 — forked from Frozenfire92/Log.cs
Unity logging wrapper, for better performance and usage.
using UnityEngine;
namespace Assets.Phunk.Core
{
public static class Log
{
#region Error
public static void ErrorFormat(UnityEngine.Object context, string template, params object[] args)
{
var message = string.Format(template, args);
@IlyaGutnikov
IlyaGutnikov / latency.markdown
Created August 30, 2017 07:29 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@IlyaGutnikov
IlyaGutnikov / .gitignore
Created August 14, 2017 18:41 — forked from FullStackForger/.gitignore
.gitignore for Unity3d project
###
# Unity folders and files
###
[Aa]ssets/AssetStoreTools*
[Bb]uild/
[Ll]ibrary/
[Ll]ocal[Cc]ache/
[Oo]bj/
[Tt]emp/
[Uu]nityGenerated/
public class Hero : MonoBehaviour
{
public string name;
private void Start()
{
var type = Assembly.GetExecutingAssembly().GetType(name);
gameObject.AddComponent(type);
}
}
@IlyaGutnikov
IlyaGutnikov / SetLayerRecurservly.cs
Created December 30, 2016 14:44
SetLayerRecurservly in Unity3D
void SetLayerRecurservly(GameObject obj, int newLayer) {
obj.layer = newLayer;
foreach (Transform child in obj.transform) {
SetLayerRecurservly(child.gameObject, newLayer);
}
package DBItems;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
/**
* @author ilyagutnikov