<php
class Date{
/**
* Функция, формирующая человекочитабельное представление разницы дат
*
* @param int $from Временная метка, от которой считаем
* @param int $to Относительная временная метка (если не задано, то сейчас)
<?php
// файлы
define('INPUT', 'input.ini'); // входной
define('OUTPUT', 'output.ini'); // выходной
/**
* Class Parser
*
<?php
class Arr{
/**
* Перемешать ассоциативный массив в случайном порядке
*
* @param array $arr
*
* @return array
<?php
/**
* Class Imap
*
* Инкапсуляция работы с почтой, по протоколу IMAP
*/
class Imap {
private $imap_stream;
<?php
// пагинация для страницы
protected function pagination($setting)
{
//$setting = array('count_page'=>100, 'this_page'=>1, 'item_link'=>7);
$page_this = $setting['this_page']; // текущая страница
$page_count = $setting['count_page']; // максимальное кол-во страниц
$item_count = $setting['item_link']; // кол-во элементов на страницу, нечетное
$item_step = ceil(($item_count-1)/2); // (шаг) кол-во элементов справа и слева от текущего
This file contains 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 | |
<?php | |
namespace App\Exceptions; | |
use Exception; | |
use Illuminate\Validation\ValidationException; | |
use Illuminate\Auth\Access\AuthorizationException; | |
use Illuminate\Database\Eloquent\ModelNotFoundException; | |
use Symfony\Component\HttpKernel\Exception\HttpException; |
This file contains 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
FROM ubuntu:trusty | |
ENV HOME /root | |
ENV LC_ALL C.UTF-8 | |
ENV LANG en_US.UTF-8 | |
ENV LANGUAGE en_US.UTF-8 | |
RUN add-apt-repository ppa:ondrej/php && \ | |
apt-get update |
This file contains 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
/* | |
* Конспект по MongoDB | |
* @author Alexey Vikarchuk | |
* @editor Amantay Eldar | |
*/ | |
//========================= ~INSTALLING ========================== | |
INSTALLING / УСТАНОВКА: | |
Самый простой способ установки MongoDB - это установка через официальный .deb пакет для LinuxUbuntu (Linux Mint и прочих ubuntu-форков). | |
1. Установите 10gen GnuPG Public Key: |
This file contains 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
var jazzicon = require('jazzicon') | |
var body = document.querySelector('body') | |
for(var i = 0; i < 600; i++) { | |
var el = jazzicon(100, 111) | |
body.appendChild(el) | |
} |
This file contains 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
var MersenneTwister = require('mersenne-twister'); | |
var seed = 111; | |
generator = new MersenneTwister(seed); | |
var body = document.querySelector('body') | |
var pre = document.createElement('pre'); | |
pre.innerHTML = JSON.stringify(generator, null, ' '); | |
body.appendChild(pre); |
OlderNewer