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 | |
use Phalcon\Paginator\Adapter\Model; | |
use Phalcon\Http\Request; | |
class Paginator extends Phalcon\Paginator\Adapter\Model { | |
public function getPaginate($page_param = false) { | |
if(!$page_param) { | |
$page_param = "page"; |
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
// update package list | |
sudo apt-get update | |
// install ImageMagick | |
sudo apt-get install imagick | |
// test if ImageMagick is working | |
cd /path/to/folder/with/images/ && convert -negate image.gif output.gif | |
// install php imagick |
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
# add this to /etc/apache2/sites-available/vagrant.conf | |
# rename "app-name" to your application name | |
# don't forget to configure your local hosts file | |
<VirtualHost *:80> | |
ServerName app-name.app-com | |
DocumentRoot "/vagrant/www/app-name/" | |
<Directory "/vagrant/www/app-name/"> | |
Options Indexes Followsymlinks | |
AllowOverride All |
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
// Add Phalcon repository | |
sudo apt-add-repository -y ppa:phalcon/stable | |
sudo apt-get update | |
// Install PhalconPHP | |
sudo apt-get install -y php5-phalcon | |
// Install PhalconPHP DevTools | |
cd ~ |
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
// execute php script from command line | |
// http://stackoverflow.com/questions/6763997/shell-run-execute-php-script-with-parameters | |
wget -O - -q -t 1 "http://mysite.com/file.php?param=value" >/dev/null 2>&1 |
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
// general update | |
sudo apt-get update | |
// general upgrade | |
sudo apt-get upgrade | |
// install midnight commander | |
sudo apt-get install mc | |
// install git |
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
git config --global credential.helper wincred |
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
// optime jpegs in folder | |
jpegoptim *.jpg —strip-all | |
// optimize jpegs recursivelly | |
find -type f -name "*.jpg" -exec jpegoptim --strip-all {} \; |
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
// display size of the folder | |
du -hs /path/to/directory |
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
// connect to database | |
mysql -u root | |
// create new database for wp | |
CREATE DATABASE wordpress; | |
// check database user in vesta cp | |
// grant database user all privileges for wp database, admin_default is database user by default | |
GRANT ALL PRIVILEGES ON wordpress.* TO admin_default@localhost; |
OlderNewer