Skip to content

Instantly share code, notes, and snippets.

View AlexTiTanium's full-sized avatar

Alex Kucherenko AlexTiTanium

View GitHub Profile
@AlexTiTanium
AlexTiTanium / ParticaleAnimator.cs
Created May 30, 2013 08:27
Time scale independent Particle system in unity3d
using UnityEngine;
using System.Collections;
public class ParticaleAnimator : MonoBehaviour {
private void Awake()
{
particle = GetComponent<ParticleSystem>();
}
@AlexTiTanium
AlexTiTanium / debug_draw_devkit.js
Last active October 13, 2016 17:18
debug draw devkit
this.render = function(ctx) {
ctx.save();
var line = this.layer.collisionLine;
var l = this.layer.l;
var c = this.layer.c;
var px = this.layer.pointX;
var py = this.layer.pointY;
@AlexTiTanium
AlexTiTanium / index.html
Last active October 6, 2016 18:55
new object allocation #jsbench #jsperf (https://jsbench.github.io/#bf0abb976a944eae6bc2cb2967c0c561) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>new object allocation #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
function Point(x, y) {
this.x = x;
this.y = y;
}
Point.prototype.getSum = function() {
return this.x + this.y;
};
@AlexTiTanium
AlexTiTanium / code.js
Last active March 12, 2016 21:39
Simple shader test
var vertices = [
-1, -1, 0,
1, -1, 0,
1, 1, 0,
-1, -1, 0,
1, 1, 0,
-1, 1, 0
];
programStars = loadProgram(gl, fs.readFileSync(__dirname + "/stars.glsl", "utf8"));
programNebula = loadProgram(gl, fs.readFileSync(__dirname + "/nebula.glsl", "utf8"));
programSun = loadProgram(gl, fs.readFileSync(__dirname + "/sun.glsl", "utf8"));
var position = [
-1, -1, 0,
1, -1, 0,
1, 1, 0,
-1, -1, 0,
1, 1, 0,
var GameObject = require('GameObject');
// Shortcuts
var game;
/**
* Player represent player objects
*
* @parent {GameObject}
*
<?php
/**
* Contact information
*/
public function defaultEvent()
{
$this->view->setTemplate('editAccount');
$form = new Form($this->getFormConfig('contactInfo'));
@AlexTiTanium
AlexTiTanium / showAllPortAndProcess
Last active December 28, 2015 01:29
Show all open port and pid
netstat -anltp | grep "LISTEN"