Skip to content

Instantly share code, notes, and snippets.

View vzabaznov's full-sized avatar

Zabaznov Vitalii vzabaznov

  • Adobe Systems Incorporated
  • Austin
View GitHub Profile
@vzabaznov
vzabaznov / ubuntu-php7.2-zts-pthreads
Created October 27, 2017 12:05 — forked from 0xfff/ubuntu-php7.2-zts-pthreads
Installing php-zts on ubuntu 16.04
#####################################################################################
# INSTALL isolated PHP 7.2 ZTS (Thread-safe) with pthreads on Ubuntu 14.04 &16.04 ###
#####################################################################################
0) Possible dependencies
sudo apt-get install libxml2-dev
1) Install necessary bison version
wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb
div {
width : 200px;
height : 50px;
position: relative;
z-index : 1;
}
div:before {
content : "";
position: absolute;
@vzabaznov
vzabaznov / generateUniqueNumber.php
Created October 1, 2014 12:01
generate unique number(not id)
public static function generateUniqueNumber($len = 9)
{
$numbers = '0123456789';
$result = mb_substr($numbers, rand(0, $len),1);
for ($i = 1; $i < $len; $i++) {
$result .= mb_substr($numbers, rand(0, $len),1);
}
return $result;
}
@vzabaznov
vzabaznov / jstz.js
Created October 1, 2014 11:54
jstz Javascript function useful to detect the browser timezone <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head><title>jstz example</title></head> <body> <script type="text/javascript" src="jstz.js"></script> <script language="JavaScript"> var tz = jstz(), text = ''; text += '<br>Timezone name: ' + tz.timezone_name; text…
"use strict";
/*
* Original script by Josh Fraser (http://www.onlineaspect.com)
* Continued and maintained by Jon Nylander at https://bitbucket.org/pellepim/jstimezonedetect
*
* Provided under the Do Whatever You Want With This Code License.
*/
/**
* Namespace to hold all the code for timezone detection.