This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
$id (int) номер игры / ни на что не влияет | |
$min (int) минимальное значение рандома | |
$max (int) максимальное | |
$api (uuid) апи ключ | |
@return (array) массив данных ответа | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://stackoverflow.com/a/4407335/3479278 */ | |
.noselect { | |
-webkit-touch-callout: none; /* iOS Safari */ | |
-webkit-user-select: none; /* Chrome/Safari/Opera */ | |
-khtml-user-select: none; /* Konqueror */ | |
-moz-user-select: none; /* Firefox */ | |
-ms-user-select: none; /* Internet Explorer/Edge */ | |
user-select: none; /* Non-prefixed version, currently | |
not supported by any browser */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Класс работы с токенами подтверждений данных | |
@author [email protected] | |
CREATE TABLE `confirm_data` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`token` varchar(32) NOT NULL, | |
`expire_time` int(11) NOT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
@param array массив для перемешивания | |
@param int семя случайных чисел | |
*/ | |
function seededShuffle(array &$array, $seed) { | |
mt_srand($seed); | |
$size = count($array); | |
for ($i = 0; $i < $size; ++$i) { | |
list($chunk) = array_splice($array, mt_rand(0, $size-1), 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.toHHMMSS = function () { | |
var sec_num = parseInt(this, 10); // don't forget the second param | |
var hours = Math.floor(sec_num / 3600); | |
var minutes = Math.floor((sec_num - (hours * 3600)) / 60); | |
var seconds = sec_num - (hours * 3600) - (minutes * 60); | |
if (hours < 10) {hours = "0"+hours;} | |
if (minutes < 10) {minutes = "0"+minutes;} | |
if (seconds < 10) {seconds = "0"+seconds;} | |
return hours+':'+minutes+':'+seconds; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.outer { | |
position: fixed; | |
top: calc(50% - 300px / 2); | |
background: red; | |
width: 300px; | |
display: flex; | |
height: 300px; | |
left: calc(50% - 300px / 2); | |
z-index: 10; | |
vertical-align: middle; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @param $c int шанс выйгрыша | |
function _randc($c){ | |
mt_srand(crc32(microtime())); | |
return (mt_rand(0, 100) < $c); | |
} | |
// test avg random | |
function random_c($c=50){ | |
$win = 0; $fail = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Example extends CI_Model | |
{ | |
const TABLE = 'example'; | |
private $CI = null; | |
private $data = []; | |
function __construct($id = null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* make full center on screen | |
* author @nyashkin | |
* */ | |
function to_center($el) { | |
$el.css('left', 'calc(50% - ' + $el.width() + 'px / 2)'); | |
$el.css('top', 'calc(50% - ' + $el.height() + 'px / 2)'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function magic(code) { | |
return atob(code); | |
} | |
$(document).ready(function(){ | |
var html = $('.content').html(); | |
var match_list = html.match(/\[loli:([a-zA-Z0-9=]+)\]/gi); | |
$(match_list).each(function(index, item){ | |
var img = magic(item.match(/\[loli:([a-zA-Z0-9=]+)\]/i)[1]); |