Skip to content

Instantly share code, notes, and snippets.

View jaxxreal's full-sized avatar
😌
Working from smoothy club

Eugeny Voronin jaxxreal

😌
Working from smoothy club
View GitHub Profile
@jaxxreal
jaxxreal / index
Created June 21, 2013 08:29
HTML5 Page Structure
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Your Website</title>
</head>
<body>
@jaxxreal
jaxxreal / clone
Created July 3, 2013 09:59
Clone object function JS
function clone(obj) {
// Handle the 3 simple types, and null or undefined
if (null == obj || "object" != typeof obj) return obj;
// Handle Date
if (obj instanceof Date) {
var copy = new Date();
copy.setTime(obj.getTime());
return copy;
}
@jaxxreal
jaxxreal / jQuery no conflict
Created July 12, 2013 05:43
Запуск JQuery вместе с другими фреймворками
jQuery. noConflict();
jQuery(function($){
/****************
Ваш код теперь может начинаться со знака "$")
****************/
$(document).ready(function(){
});
});
@jaxxreal
jaxxreal / jquery.ui.datepicker-ru
Last active December 19, 2015 23:49
/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Andrew Stromnov (stromnov@gmail.com). */
jQuery(function($){
$.datepicker.regional['ru'] = {
closeText: 'Закрыть',
prevText: '&#x3c;Пред',
nextText: 'След&#x3e;',
currentText: 'Сегодня',
monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
@jaxxreal
jaxxreal / gist:6249493
Created August 16, 2013 12:31
check var is array
if (var instanceof Array)
{
alert "Var is array!";
}
else
{
alert "Var isn't array!";
}
@jaxxreal
jaxxreal / swap variables
Created September 18, 2013 07:45
Swap variables
b = [a, a = b][0];
function getPolygoneCentroid(polygone){
var centroid = {x:0, y:0};
var signedArea = 0;
var x0 = 0; // Current vertex X
var y0 = 0; // Current vertex Y
var x1 = 0; // Next vertex X
var y1 = 0; // Next vertex Y
var a = 0; // Partial signed area
@jaxxreal
jaxxreal / geofence.js
Created October 14, 2013 07:48
Valid color generator
(function(m,s,c){return (c ? arguments.callee(m,s,c-1) : '') +
s[m.floor(m.random() * s.length)]})(Math,'0123456789ABCDEF',5)
@jaxxreal
jaxxreal / print.js
Last active December 26, 2015 06:29
Simply clever JS print element!
w=window.open();
w.document.write($('.report_left_inner').html());
w.print();
w.close();