Skip to content

Instantly share code, notes, and snippets.

View gluschenko's full-sized avatar
:octocat:

Alexander Gluschenko gluschenko

:octocat:
View GitHub Profile
function isMobile() {
if( navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)){
return true;
}
public static object GetPropValue(object src, string propName)
{
return src.GetType().GetProperty(propName).GetValue(src, null);
}
var mid = function (v) {
var cx = 0;
var cy = 0;
for (var i = 0; i < v.length; i++) {
cx += v[i].x;
cy += v[i].y;
}
cx /= v.length;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class ComboText : MonoBehaviour {
public static List<ComboEntry> Entries = new List<ComboEntry>();
public float Speed = 10;
public static float Offset = 90;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Test : MonoBehaviour {
List<GameObject> people = new List<GameObject>();
Vector2 ScrollPos = new Vector2(0, 0);
using UnityEngine;
using System;
using System.Collections.Generic;
public class DebugConsole : MonoBehaviour
{
struct ConsoleMessage
{
public readonly string message;
public readonly string stackTrace;
function getmess(){
$.ajax({
url:"get_mess.php",
type:"POST",
data:{"id":id},
cahce:false,
timeout:30000,
async:true,
success:function(result){
$("#response").html(result);
<html>
<head>
<title>Генератор случайных чисел</title>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
function Write(id, val) {
Find(id).innerHTML = val;
}
public static T[] Concat<T>(this T[] x, T[] y)
{
if (x == null) throw new ArgumentNullException("x");
if (y == null) throw new ArgumentNullException("y");
int oldLen = x.Length;
Array.Resize<T>(ref x, x.Length + y.Length);
Array.Copy(y, 0, x, oldLen, y.Length);
return x;
}
using System;
using System.Collections;
/*
Usage:
* GUI.Label(new Rect(10, 10, 100, 100), Local.Get("Play"));
*
*/
public class Local {