A Pen by Pavel Volyntsev on CodePen.
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 | |
/** | |
* @file protected/components/FriendlyPassword.php | |
*/ | |
/** | |
* Class FriendlyPassword | |
* | |
* Generates passwords like that: random_static_word + random_number + random_dynamic_word | |
* |
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
# задача: приложение реализовать на Yii, а статьи публиковать в Wordpress и всё это на одном адресе и на одном порту : http://icons8.com/ | |
# обсуждается на хабре http://habrahabr.ru/company/dataart/blog/236635/ | |
# там же ссылки ещё на 5 примеров интеграции Wordpress и Yii | |
# конфиг верхнего уровня для перенаправления запросов на приложение Yii или блог wordpress | |
server { | |
listen 80; | |
#server_name icons8.com; | |
#error_log /var/log/icons8.com/error.log; | |
#access_log /var/log/icons8.com/access.log; |
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 | |
class m141202_180046_icon_created extends CDbMigration | |
{ | |
// установка обновления | |
public function up() | |
{ | |
$this->addColumn('icons_by_name_view', 'created', 'datetime NOT NULL'); | |
$this->addColumn('similar_view', 'created', 'datetime NOT NULL'); | |
$this->refreshTableSchema('icons_by_name_view'); |
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 | |
/** | |
* Class LazyHttpSession | |
* Обеспечивает подавление создания сессий PHP | |
* | |
* @author pavel.volyntsev@gmail.com | |
* @link http://copi.st/nMen | |
*/ | |
class LazyHttpSession extends CCacheHttpSession // здесь надо указать супер-класс, используемый в твоём приложении |
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 | |
/** | |
* Ответ на вопрос https://otvet.mail.ru/question/188212525 | |
*/ | |
$arr = array(1,2,3,0,4,5,6,0,8,9,10); // твой массив | |
$arr = array_reverse($arr); | |
$sum = 0; | |
foreach($arr as $element) |
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 | |
/** | |
* Ответ на вопрос https://otvet.mail.ru/question/188209129 | |
*/ | |
$arr = array(1,2,3,0,4,5,6,0,8,9,10); // твой массив | |
$valueToFind = 0; // значение, которое надо найти | |
$valueFound = false; // найдено ли искомое значение | |
$sum = 0; | |
foreach($arr as $element) | |
{ |
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
<div class="b-form-wrap"> | |
<p id="validation-fail-msg">Please, fill in the missing fields.</p> | |
<form novalidate id="feedback-form"> | |
<div class="b-form-box"> | |
<p class="form-box__text form-box__text_no-pad">What's your name?<sup class="form-box__sup">*</sup></p> | |
<input type="text" name="name" maxlength="30" required id="name-input" class="form-box__input-field"> | |
<p class="form-box__text">What's your phone number?<sup class="form-box__sup">*</sup></p> | |
<input type="text" name="phone" maxlength="30" required id="phone-input" class="form-box__input-field"> | |
<p class="form-box__text">What's your email?<sup class="form-box__sup">*</sup></p> | |
<input type="text" name="email" maxlength="50" required id="email-input" class="form-box__input-field"> |
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 | |
/** | |
* Пример набора классов для демонстрации роутинга с помощью набора роутеров | |
*/ | |
/** | |
* Статический роутер, умеет проверять URI на полное совпадение с одним из элементов списка путей | |
*/ | |
class StaticRouter implements RouterInterface | |
{ |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
OlderNewer