Skip to content

Instantly share code, notes, and snippets.

View maliMirkec's full-sized avatar
🤘
I’m really good at this without realising how.

Silvestar Bistrović maliMirkec

🤘
I’m really good at this without realising how.
View GitHub Profile
@maliMirkec
maliMirkec / Paginator.php
Last active August 29, 2015 14:21
Phalcon Paginator with full URI
<?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";
@maliMirkec
maliMirkec / imagick
Created June 15, 2015 06:03
How to install and include ImageMagick on ubuntu
// 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
@maliMirkec
maliMirkec / VagrantPhalconHost.conf
Last active October 17, 2015 07:59
How to add and configure host on Vagrant Phalcon
# 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
@maliMirkec
maliMirkec / phalcon-update
Last active October 17, 2015 07:58
How to update Phalcon on Vagrant
// 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 ~
@maliMirkec
maliMirkec / cmd
Created August 18, 2015 07:02
how to execute php script from command line
// 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
@maliMirkec
maliMirkec / local-vagrant-dev-serv
Last active July 5, 2017 21:21
Local vagrant developement server - Vesta, PhalconPHP, Git, NodeJs, Bower, Grunt, Gulp, Yeoman
// general update
sudo apt-get update
// general upgrade
sudo apt-get upgrade
// install midnight commander
sudo apt-get install mc
// install git
@maliMirkec
maliMirkec / cache-github-credentials
Created October 7, 2015 05:40
Cache GitHub credentials
git config --global credential.helper wincred
@maliMirkec
maliMirkec / jpegoptim
Last active May 27, 2016 08:11
Optimize images using jpegoptim script
// optime jpegs in folder
jpegoptim *.jpg —strip-all
// optimize jpegs recursivelly
find -type f -name "*.jpg" -exec jpegoptim --strip-all {} \;
@maliMirkec
maliMirkec / folder-size
Created October 14, 2015 18:58
Display size of the folder
// display size of the folder
du -hs /path/to/directory
@maliMirkec
maliMirkec / wp-install
Created October 15, 2015 12:09
Wordpress installation on Ubuntu
// 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;