Skip to content

Instantly share code, notes, and snippets.

View gluschenko's full-sized avatar
:octocat:

Alexander Gluschenko gluschenko

:octocat:
View GitHub Profile
#include <iostream>
#include <vector>
using namespace std;
void trace(int n)
{
int nmem = n;
vector<int> M;
#include <iostream>
#include <windows.h>
using namespace std;
#define c 261
#define d 294
#define e 329
#define f 349
#define g 391
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]};}
<?php
$api_id = 1;
$api_secret = "APP_SERVICE_TOKEN";
$message_text = "Test";
$current_users_list = array();
$current_offset = 0;
function Send()
@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
$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 / 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
{
// From GeoEngine scripts
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshCollider))]
public class Landscape : MonoBehaviour {
Web = new function () {
function CreateXMLHTTP() { // кроссбраузерный костыль на случай атомной войны (со всякими IE 6)
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
@gluschenko
gluschenko / Chrome-Cache-Viewer.js
Last active December 22, 2015 16:54
Paste this code to the developer console (F12).
document.body.innerHTML = "<div id='iii'></div>" + document.body.innerHTML;
var iii = document.getElementById("iii");
var table = document.getElementsByTagName("table")[0];
table.style.display = "none";
var dom = document.getElementsByTagName("a");
var count = 0;
var interval = setInterval(function(){