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 // PHP код должен быть заключен в теги <?php | |
// Если ваш файл содержит только PHP-код, то можно | |
пропустить закрывающий ?> | |
// А так начинаются комментарии | |
# Это тоже комментарий но // предпочтительнее |
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 | |
$modx->regClientStartupHTMLBlock('<script>Ext.onReady(function() { | |
if(MODx.loadRTE) MODx.loadRTE("modx-resource-introtext"); | |
});</script>'); | |
//Создать плагин на событие OnDocFormRender |
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 CustomOrder extends msOrderHandler{ | |
public function getCost($with_cart = true, $only_cost = false) { | |
$response = $this->ms2->invokeEvent('msOnBeforeGetOrderCost', array( | |
'order' => $this, |
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
Изменить origin адрес репозитория двумя способами: | |
1) Первый способ задать url репозитория: | |
использовать команду git remote set-url origin, например: | |
git remote set-url origin [email protected]:vicman-wi/wi-backend.git | |
2) Второй способ: |
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
Для предотвращения просмотра директорий сайта добавьте в .htaccess следующий код: | |
Options All -Indexes |
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
sudo apt-get install gource | |
git clone git://github.com/php/php-src.git php | |
cd php | |
git log --since=2012 --pretty=format:user:%aN%n%at --reverse --raw --encoding=UTF-8 --no-renames > php.2012.log | |
gource --seconds-per-day .05 1920x1080 --auto-skip-seconds .05 --multi-sampling --stop-at-end --highlight-users --hide mouse,progress --file-idle-time 13 --max-files 0 --background-colour 000000 --font-size 26 --logo php.png --output-ppm-stream - --output-framerate 30 php.2012.log | avconv -y -r 30 -f image2pipe -vcodec ppm -i - -b 32768k php.mp4 | |
//Что бы сохранить видео то | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.mp4 |
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. Linux-система, я делал на пользовательской сборке Ubuntu 16.04, в других системах устанавливаемые пакеты могут отличаться именами | |
2. Диск с Win 7, комплект драйверов и SPFlashTool для винды, на случай возникновения нештатной ситуации, как у меня было. Улыбающийся | |
Пренебрегать "соломкой" не следует. | |
3. Лупа! Сообщения на экране смарта в режиме отладки очень мелкие. | |
Итак: | |
1. Ставим на комп adb и fastboot, для Ubuntu - по инструкции Прошивка Android в Ubuntu c помощью ADB/Fastboot http://4pda.ru/pages/go/?u=https%3A%2F%2Fandroidp1.ru%2Fproshivka-android-v-ubuntu-c-pomoshhyu-adb-fastboot%2F&e=65163871 | |
Для этого нужно открыть терминал и ввести следующие команды: | |
Код: | |
sudo apt-get install android-tools-adb |
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
$(document).ready(function() { | |
$(document).on('change', '#mse2_sort', function() { | |
var selected = $(this).find('option:selected'); | |
var sort = selected.data('sort'); | |
sort += mse2Config.method_delimeter + selected.val(); | |
mse2Config.sort = sort; | |
mSearch2.submit(); | |
}); | |
}); |
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
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
#### I MODIFIED HERE!!! | |
Options +FollowSymLinks | |
RewriteEngine On | |
## | |
## You may need to uncomment the following line for some hosting environments, |
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 | |
//Считаем проценты | |
$percent = $old_price/100; | |
$result = $price/$percent; | |
$result = ceil(100-$result); | |
return $result; |