Skip to content

Instantly share code, notes, and snippets.

View yupe's full-sized avatar
🤔

Yupe! team yupe

🤔
View GitHub Profile
@yupe
yupe / style.css
Last active December 7, 2022 06:04
Как в Yii2 добавить звездочку к обязательным полям формы
form div.required label.control-label:after {
content:" * ";
color:red;
}
@yupe
yupe / yupe-menu.php
Last active August 26, 2015 12:01
Yupe menu widget
$this->widget('application.modules.menu.widgets.MenuWidget', ['name' => 'top-menu-'.Yii::app()->language]);
n = [3, 5, 7]
def double_list(x):
n.append('!')
print n
# Don't forget to return your new list!
print double_list(n)
numbers = [1, 2, 3, 4]
double_first(numbers)
print numbers
@yupe
yupe / gist:93fb9d66a94d97bccf27
Last active August 29, 2015 14:14
Yupe cms смена урлов панели управления
<?php
return [
'component' => [
'request' => [
'class' => 'yupe\components\HttpRequest',
// пути, исключенные из csrf-валидации
'noCsrfValidationRoutes' => ['admin/AjaxImageUpload', 'admin/AjaxFileUpload'],
]
],
@yupe
yupe / gist:44f135d16cce8495374f
Created December 29, 2014 12:27
DDD BOOK FROM KUKURUZOVICH-ДЖЕДАЙ-НИНДЗЯ-СЕНСЕЙ-МАСТЕР
XP:
http://www.amazon.com/Test-Driven-Development-By-Example/dp/0321146530
http://www.amazon.com/Extreme-Programming-Explained-Embrace-Edition/dp/0321278658/ref=pd_sim_b_3
BDD:
story:
http://dannorth.net/whats-in-a-story/
http://www.amazon.com/The-Cucumber-Book-Behaviour-Driven-Development/dp/1934356808
server {
server_name crm.local;
root /var/www/crm/web;
location / {
# try to serve file directly, fallback to app.php
try_files $uri /app.php$is_args$args;
}
location ~ ^/(app|app_dev|config|install)\.php(/|$) {
{% extends "layouts/main.twig" %}
{% block title %}{{ post.title }}{% endblock %}
{% block description %}{{ post.getQuote() }}{% endblock %}
{% block keywords %}yii, yiiframework, юпи!, yupe, блог, записи{% endblock %}
{% block content %}
<section id="blog-post" class="light-bg">
<div class="container inner-top-sm inner-bottom classic-blog">
@yupe
yupe / gist:8ec8e205ce7b6ce57600
Created June 5, 2014 10:47
EventDispatcher wrapper
<?php
namespace yupe\components;
use Symfony\Component\EventDispatcher\Event;
use Yii;
use CApplicationComponent;
use Symfony\Component\EventDispatcher\EventDispatcher;
class EventManager extends CApplicationComponent
public function publish()
{
$transaction = Yii::app()->db->beginTransaction();
try
{
$this->status = self::STATUS_PUBLISHED;
$this->publish_date = date('d-m-Y h:i');
if($this->save()) {
Yii::app()->eventManager->fire(PostEvents::POST_PUBLISH, new PostPublishEvent($this, Yii::app()->getUser()));