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
const unsortedArr = [4, 5, 6, 7, 8, 2, 1, 3, 4, 2, 0, 150, 7, 9]; | |
const sortedArr = bubleSort(unsortedArr); | |
console.log(sortedArr); | |
function bubleSort(arr) { | |
let len = arr.length; | |
for (let i = 0; i < len; i++) { | |
for (let j = 0; j < len; j++) { | |
if (arr[j] > arr[j+1]) { | |
let tmp = arr[j]; |
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
1 – very simple task (0 – 2h) | |
2 – simple task (2h - 1d) | |
3 – normal task (1 – 1.5d) | |
5 – average difficulty ( 2-2.5d) | |
8 – complex (3d-5d) | |
13+ - very complex task and we need to split it |
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
#!/bin/bash | |
vmName="Windows Server 2008 R2" | |
if VBoxManage showvminfo "$vmName" | grep -c "running (since" | |
then | |
echo Save state of VM... | |
VBoxManage controlvm "$vmName" savestate | |
else | |
echo Runnng VM... | |
VBoxManage startvm "$vmName" --type headless |
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
#!/bin/bash | |
echo 'Install PMA...' | |
wget -O pma.zip http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.4.3/phpMyAdmin-4.4.3-all-languages.zip | |
unzip pma.zip | |
mv phpMyAdmin-4.4.3-all-languages phpmyadmin/ | |
rm -rf pma.zip | |
exit 0 |
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
$query = Shop::find()->multilingual(); | |
$query->joinWith(['translations']); | |
//echo '<pre>', var_dump($query), '</pre>';die; | |
$dataProvider = new ActiveDataProvider([ | |
'query' => $query, | |
]); | |
$dataProvider->sort->attributes['title'] = [ |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
function isDateInPast(strDate) { | |
var arDate = explode('.' ,strDate); | |
var insertedDate = new Date(arDate[2]+'-'+arDate[1]+'-'+arDate[0]); | |
var strCurrentDate = $('input[name="current_date"]').val(); | |
var arCurrentDate = explode('.', strCurrentDate); | |
var currentDate = new Date(arCurrentDate[2]+'-'+arCurrentDate[1]+'-'+arCurrentDate[0]); | |
if(insertedDate < currentDate) { | |
return true; | |
} else { | |
return false; |
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
function explode( delimiter, string ) { | |
// Split a string by string | |
// | |
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
// + improved by: kenneth | |
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
var emptyArray = { 0: '' }; |
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
Тут есть 2 варианта: полноценные браузеры и не полноценные. Полноценные загружают и понимают яваскрипт/CSS, неполноценные — только HTML. С полноценными все гораздо сложнее и медленнее, но они обеспечивают лучшее качество тестирования. Начнем с полноценных. | |
Это Selenium либо phantomjs и фреймворки на его основе. Selenium — это набор драйверов, которые встраиваются в браузеры (Хром, ФФ, ИЕ) и позволяют управлять ими: загрузить страницу: нажать кнопку и т.д. Соответственно, ты можешь программно загружать свой сайт и делать на нем какие-то действия в реальном браузере. | |
Все это работает, естественно, достаточно криво. Например может выскочить какое-нибудь окошко обновления браузера и сломать тест. Сам селениум тоже написан неидеально. Ну и запускать надо на отдельном сервере, иначе ты будешь мешать проведению тестов. | |
Если ты хочешь тестировать под разными ОС (Мак/винда) то надо минимум 2 сервера (или виртуалки). | |
phantomjs — это «безголовая» версия браузера на вебките (тот же движок что и в Хроме), то есть брау |