I hereby claim:
- I am fdcore on github.
- I am nyashkin (https://keybase.io/nyashkin) on keybase.
- I have a public key ASA_th1q1SEqIGZDtAgr3Cr7ZcEdBTtx1QWrt7sjv3MCWQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| $data = array( | |
| [ | |
| 'measurement' => 'time', | |
| 'tags' => [ | |
| "host" => 'server02', | |
| ], | |
| 'fields' => ['value' => mt_rand(1, 100)], | |
| 'timestamp' => exec('date +%s%N') |
| <?php | |
| function redirect_no_referral($url) | |
| { | |
| echo '<!doctype html> | |
| <html> | |
| <head> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
| <meta http-equiv="cache-control" content="max-age=0" /> | |
| <meta http-equiv="cache-control" content="no-cache" /> |
| <?php | |
| /* | |
| Высчитываение средней медианы | |
| @params array массив чисел | |
| */ | |
| function array_median($array) { | |
| // perhaps all non numeric values should filtered out of $array here? | |
| $iCount = count($array); | |
| if ($iCount == 0) { | |
| throw new Exception('Median of an empty array is undefined'); |
| <div id="app"> | |
| <div> | |
| <button @click="sort_by='name'">name</button> | |
| <button @click="sort_by='price'">price</button> | |
| <button @click="sort_by='count'">count</button> | |
| </div> | |
| <hr> | |
| <div> | |
| <button @click="by_desc=true">ASC</button> |
| <?php | |
| /* | |
| Функция случайности с приоритетом | |
| @author Dmitriy Nyashkin | |
| @param (array) arr - Array with priority key | |
| @param (string) priority_key - Array key for use priority | |
| @return array - single array | |
| */ | |
| function random_priority($arr, $priority_key = 'priority') | |
| { |
| /* | |
| #mobile_element { | |
| display: none; | |
| } | |
| @media (max-width: 768px) { | |
| #mobile_element { | |
| display: block; | |
| } | |
| } | |
| */ |
| 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]); |
| /* | |
| * 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)'); | |
| } |
| <?php | |
| class Example extends CI_Model | |
| { | |
| const TABLE = 'example'; | |
| private $CI = null; | |
| private $data = []; | |
| function __construct($id = null) |