-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
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
server { | |
listen 80; | |
server_name app.rehanmanzoor.me; | |
charset utf-8; | |
client_max_body_size 1M; | |
location / { | |
proxy_pass http://127.0.0.1:8001; | |
proxy_http_version 1.1; |
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 | |
/** | |
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes | |
* | |
* You may also want a list of unofficial codes: | |
* | |
* 103 => 'Checkpoint', | |
* 218 => 'This is fine', // Apache Web Server | |
* 419 => 'Page Expired', // Laravel Framework |
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
Все примеры расположены в порядке уменьшения нагрузки на БД и при равенстве кол-ва запросов в порядке уменьшения кол-ва строк кода. Сверху самый ресурсоёмкий по кол-ву запросов к БД. | |
/////////////////////////////////////////////////////////// | |
Пустая страница MODX при отключенном кэше: | |
кол-во зпросов/время запросов/время выполнения PHP кода/общее время | |
6/0.0002 s/0.0336 s/0.0338 s | |
*********************************************************** | |
1-ый код с pdoFetch, все методы: | |
$pdo = $modx->getService('pdoFetch'); | |
$pdo->setConfig(array( |
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 | |
/* | |
* fontAwesomeInputOptions | |
* MODX Snippet | |
* @author YJ Tso @sepiariver | |
* GPL, no warranties, etc. | |
* | |
* Usage: execute in TV input options, preferably with @CHUNK binding | |
* alternatively install as Content Blocks input (link to repo coming soon) | |
*/ |
Настоящий документ предназначен для ознакомления пользователя с функциональными возможностями языка разметки Markdown. Markdown – это облегченный язык разметки, который является инструментом преобразования кода в HTML. Главной особенностью данного языка является максимально простой синтаксис, который служит для упрощения написания и чтения кода разметки, что, в свою очередь, позволяет легко его корректировать. Теперь рассмотрим более подробно функции языка разметки Markdown.
Markdown не является заменой HTML. Синтаксис Markdown достаточно ограничен, и соответствует лишь небольшому подмножеству элементов HTML. Он включает в себя следующие элементы:
- Блочные элементы
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
/** | |
* @desc Do cURL request to some API | |
* @author Misha M.-Kupriyanov https://plus.google.com/104512463398531242371/ | |
* @link https://gist.github.com/5055906 | |
*/ | |
$currentSID = null; | |
$SESSION_NAME = '<PUT_YOUR_SESSION_NAME_HERE>'; | |
$API_KEY = '<PUT_YOUR_API_KEY_HERE>'; | |
$API_URL = 'http://host/api/v1/?alt=json' |
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 | |
// specify your css-files and their order here | |
$cssFiles = array( | |
'normalize.css', 'style.css', 'print.css', 'colorbox.css' | |
); | |
// the file to write the compressed css to | |
$minFileName = 'minified.css'; | |
// thats all, just call this file in your browser and it will | |
// build you a minimized css-file. then just link to this single |
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 | |
$chunk = 'tpl.msdfcMsg'; | |
$discounts = array( | |
'100000' => '10%', | |
'150000' => '15%', | |
'200000' => '20%', | |
); | |
krsort($discounts); | |
reset($discounts); | |
$actionKey = 'msdfc_action'; |
NewerOlder