This file contains hidden or 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 | |
//symfony 1.4 - get all form errors by field | |
foreach( $this->form->getFormFieldSchema( ) as $name => $formField ) | |
{ | |
if( $formField->getError( ) != "" ) | |
{ | |
print( $name . " : " . $formField->getError( ) . "\n" ); | |
} | |
} |
This file contains hidden or 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
#~/.bashrc | |
alias go='git checkout ' |
This file contains hidden or 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 | |
/** | |
* Возвращает слово с нужным окончанием в зависимости от количества | |
* | |
* @param int $n - количество в зависимости от которого необходима нужная форма слова | |
* @param string $form1 - форма слова для 1 штуки | |
* @param string $form2 - форма слова для 2 штук | |
* @param string $form2 - форма слова для 11 штук | |
*/ | |
function get_end_of_word_by_quantity($n, $form1, $form2, $form5) |
This file contains hidden or 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
function Validate () { | |
this.byValidatorsArray = function(value, validators) { | |
var result = true; | |
var arrayLength = validators.length; | |
for(var i = 0; i < arrayLength; i++) { | |
if(!this[validators[i]](value)) { | |
result = false; | |
} | |
} |
This file contains hidden or 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
/** | |
* Return zodiac sugn by month and day | |
* | |
* @param day | |
* @param month | |
* @return {string} name of zodiac sign | |
*/ | |
function getZodiacSign(day, month) { | |
var zodiacSigns = { |
NewerOlder