Skip to content

Instantly share code, notes, and snippets.

View gluschenko's full-sized avatar
:octocat:

Alexander Gluschenko gluschenko

:octocat:
View GitHub Profile
// From GeoEngine scripts
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshCollider))]
public class Landscape : MonoBehaviour {
@gluschenko
gluschenko / Queues.cs
Created April 24, 2016 11:31
Small queue system
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestTestTest
{
class Program
{
<?php
$image = imagecreatetruecolor(180,40);
// Пишет текст и применяет размытие к изображению
imagestring($image, 5, 10, 8, 'Gaussian Blur Text', 0x00ff00);
$gaussian = array(array(1.0, 2.0, 1.0), array(2.0, 4.0, 2.0), array(1.0, 2.0, 1.0));
imageconvolution($image, $gaussian, 16, 0);
// Переписывает текст для сравнения
imagestring($image, 5, 10, 18, 'Gaussian Blur Text', 0x00ff00);
@gluschenko
gluschenko / IK.cs
Created January 7, 2017 20:58
Inverse kinematics, Unity3D
using UnityEngine;
using System.Collections;
public class IK : MonoBehaviour {
public Vector3 Target = new Vector3(-8, 0, 0);
public Vector3 BendTarget = new Vector3(-4, 0, 3);
public float Transition = 1f;
public GameObject[] Members = new GameObject[3];
<?php
$api_id = 1;
$api_secret = "APP_SERVICE_TOKEN";
$message_text = "Test";
$current_users_list = array();
$current_offset = 0;
function Send()
function get_browser_info(){
var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
//console.log(M[0]+" "+M[1]);
if(/trident/i.test(M[1])){
tem=/\brv[ :]+(\d+)/g.exec(ua) || [];
return {name:'IE',version:(tem[1]||'')};
}
if(M[1]==='Chrome'){
tem=ua.match(/\bOPR\/(\d+)/)
if(tem!=null) {return {name:'Opera', version:tem[1], chromeversion: M[2]};}
#include <iostream>
#include <windows.h>
using namespace std;
#define c 261
#define d 294
#define e 329
#define f 349
#define g 391
#include <iostream>
#include <vector>
using namespace std;
void trace(int n)
{
int nmem = n;
vector<int> M;
<style>
body
{
margin: 0;
}
</style>
<div>
<canvas id='LinesX2' width='1024' height='600' style='display: block;'></canvas>
</div>
@gluschenko
gluschenko / TimeMachine.cs
Created July 21, 2017 22:20
C# execution timer
using System;
using System.Collections.Generic;
using System.Diagnostics;
public class TimeMachine
{
public static Dictionary<string, Stopwatch> Timers = new Dictionary<string, Stopwatch>();
public static void Start(string name)
{