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 / 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
@yupe
yupe / gist:6547244
Created September 13, 2013 06:21
А вот так тесты писать приятнее +) Codeception рулит =)
<?php
use \WebGuy;
class UserLoginCest
{
public function testLoginPage(WebGuy $I) {
$I->amOnPage('/user/account/login');
$I->seeInTitle('Войти');
$I->seeLink('Забыли пароль?');
$I->see('Войти');
<?php
$I = new WebGuy($scenario);
$I->wantTo('Test "contact" page of amyLabs site!');
$I->amOnPage('/contact');
// check title
$I->see('Наши контакты','h2');
// check contact information
foreach ($contacts as $contact){
<?php
/**
* Craft by Pixel & Tonic
*
* @package Craft
* @author Pixel & Tonic, Inc.
* @copyright Copyright (c) 2013, Pixel & Tonic, Inc.
* @license http://buildwithcraft.com/license Craft License Agreement
* @link http://buildwithcraft.com
use strict;
use warnings;
use 5.010;
use Data::Dumper;
use Mojo::UserAgent;
use Mojo::JSON;
my $user = 'xomaa';
my $url = "https://api.twitter.com/1/favorites.json?count=3&include_entities=1&id=$user";
my $ua = Mojo::UserAgent->new;
@yupe
yupe / php-storm-format-after
Created September 14, 2011 13:15
после
$comment->setAttributes(array(
'userId' => Yii::app()->user->getId(),
'name' => Yii::app()->user->getState('nickName'),
'email' => Yii::app()->user->getState('email'),
));
@yupe
yupe / php-storm-format
Created September 14, 2011 13:14
До
$comment->setAttributes(array(
'userId' => Yii::app()->user->getId(),
'name' => Yii::app()->user->getState('nickName'),
'email' => Yii::app()->user->getState('email'),
));
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