Skip to main content

Posts

Showing posts from June, 2015

How to detect jQuery mmenu close event

A few days ago, I was trying jQuery mmenu. I had a close button (called #mmenu-btn ) that changed shape between open and close states and I wanted to make sure that it will never get stuck in a state different than the desired one.      After some reading in the mmenu docs about events and configurations, and after playing a lot with the button and mmenu on desktop and mobile, I had two states to cover: 1- An event is triggered by code (mmenu API): In this case, it is my code, so I can handle it. 2- The user clicks/touches the part outside the mmenu. In this case, the mmenu does not tell me that it is closing now. For the second case, I found a nice solution that depends on how mmenu works. When mmenu opens, there is a created overlay called #mm-blocker that covers the part outside the menu. When this overlay is clicked, the mmenu is closed. So what I did was to bind the click event (and other similar events) of this #mm-blocker and do whatever I want to ...

Nginx + Slim Framework + phpMyAdmin on Ubuntu

Yesterday I was giving Slim Framework a test ride on my Ubuntu machine. But the machine was not ready with Nginx, or phpMyAdmin (I needed it to check the output of an ORM called RedBean ). So I'm writing what I did exactly for my reference and for other's benefit. First, in case you don't have any of the following packages, go ahead and do it Installations: Install MySQL sudo apt-get install mysql-server php5-mysql and remember your root password you will enter in the installation process. Install Nginx sudo apt-get install nginx Install PHP-FPM (PHP FastCGI Process Manager) sudo apt-get install php5-fpm Install phpMyAdmin sudo apt-get install phpmyadmin During installation, you will be asked to choose your web server (apache2/lighttpd). But since we will use Nginx, just press the TAB key then Enter. Then you will be asked if you want to proceed with phpMyAdmin database configurations, choose yes and continue then enter your MySQL root passw...