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
Search and replace | |
https://wp-cli.org/commands/search-replace/ | |
wp search-replace | |
wp search-replace 'http://example.dev' 'http://example.com' | |
Optmize database | |
https://wp-cli.org/commands/db/optimize/ | |
wp db optimize | |
Repair database |
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
gzip -d backup-20100910164109.sql.gz |
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
/** | |
* AJAX обертка для WordPress REST API | |
*/ | |
let sb_ajax = function ( ep, success, error, type = 'GET', data = '' ) { | |
url = wpApiSettings.root + ep; | |
// Feature detection | |
if ( !window.XMLHttpRequest ) return; |
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 | |
if(empty($_GET['username']) ){ | |
$_GET['username'] = 'vagrant'; | |
} | |
function adminer_object() { | |
class AdminerSoftware extends Adminer { | |
function credentials() { |
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
/** | |
* Get data from a URL | |
* @param {String} url The URL to get | |
* @param {Function} success Callback to run on success | |
* @param {Function} error Callback to run on error | |
*/ | |
var getURL = function ( url, success, error ) { | |
// Feature detection | |
if ( !window.XMLHttpRequest ) return; |
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
#!/bin/bash | |
crontab -l | { cat; echo "*/1 * * * * curl http://site.lcl/wp-cron.php?doing_wp_cron > /dev/null 2>&1"; } | crontab - |
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 { | |
# base nginx conf | |
location ~ ^/wp-content/uploads/(.*) { | |
try_files $uri @live_uploads; | |
} | |
location @live_uploads { |
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
echo "Loading ioncube" | |
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz | |
echo "Unzipping ioncube" | |
tar xvfz ioncube_loaders_lin_x86-64.tar.gz | |
echo "Move ioncube to usr/local" | |
mv ioncube /usr/local | |
echo "Add ioncube to php.ini" | |
sudo sed -i 1i"zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so" /etc/php5/fpm/conf.d/zzzz_custom.ini | |
sudo sed -i 1i"zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so" /etc/php5/cli/conf.d/zzzz_custom.ini | |
echo "Restarting Apache and FPM" |
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 | |
/** | |
* AmoCRM API Wrapper | |
*/ | |
class WooAC_API_Wrapper | |
{ | |
protected $curl; | |
protected $url_domain; |