Categories
Uncategorized

Reusable Responsive Contact Form using HTML 5 Web Components & Polymer

Github
Download the files from git.
Run the install.php from your browser (Make sure your directory is writable by the web server you have installed).

contact form install

Open your web directory address in a browser and you should see a demo contact form. You can embed these contact forms by simply placing the following tag in your template anywhere to reuse the contact form.

Also make sure you include the following lines anywhere on the page where you want to use the contact form. Note that it is not necessary to include the Javascript files before you use the contact form tag, it works even if the code is loaded after the contact tag is loaded.

  

Demo

Usage:



    
  
  
     

contact form

 

Categories
Uncategorized

HHVM + WordPress Permalinks Issue Resolved

Once HHVM (Hip Hop Virtual Machine) is installed and running, you might have an issue that shows only the Homepage of your WordPress site and the other links lead to a 404 not found. This issue can be quickly resolved.

Open the HHVM proxy configuration file using your favourite editor with root privileges.

sudo nano /etc/apache2/mods-available/hhvm_proxy_fcgi.conf

Add the following line to hhvm config file after editing the path to your WordPress installation. The following line of code assumes that the WordPress installation is in your root web directory.

ProxyPassMatch ^(?!\/wp\-admin\/)([^\.]+)$ fcgi://127.0.0.1:9000/var/www/html/index.php

Your HHVM proxy configuration file should look somewhat similar to this

ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/$1
ProxyPassMatch ^(?!\/wp\-admin\/)([^\.]+)$ fcgi://127.0.0.1:9000/var/www/html/index.php

Now restart the HHVM

sudo service hhvm restart

This should take care of your permalinks issue.

The above HHVM proxy configuration file makes sure that all the php request are routed through HHVM. But if you want to route only specific php requests for a particular website or directory from your server to HHVM, then just add the config lines in your Virtual Hosts section of your apache configuration file. For example,

<VirtualHost *:80>
    ServerName yoursite.com

    DirectoryIndex index.php
    DocumentRoot /var/www/html/yoursite

    ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/yoursite/$1
    ProxyPassMatch ^(?!\/wp\-admin\/)([^\.]+)$ fcgi://127.0.0.1:9000/var/www/html/yoursite/index.php

  </VirtualHost>  

  <VirtualHost *:443>
    ServerName yoursite.com

    DirectoryIndex index.php
    DocumentRoot /var/www/html/yoursite

    SSLEngine On
    SSLCertificateFile   /etc/ssl/certs/yoursite.crt
    SSLCertificateKeyFile    /etc/ssl/private/yoursite.key
    SSLCACertificateFile  /etc/ssl/certs/yoursite.ca.crt

    ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/yoursite/$1
    ProxyPassMatch ^(?!\/wp\-admin\/)([^\.]+)$ fcgi://127.0.0.1:9000/var/www/html/yoursite/index.php

</VirtualHost>
Categories
Uncategorized

Just Upload – Transfer files without User Registration

Here is a small app that I have written to be able to send files to emails without user registration.

Link

Categories
Uncategorized

Implementing an ATM App using js

This is a simple ATM app that uses HTML 5, CSS3 & js.

atm

Code 

Demo1

Demo2

Use Card Number: 9299455566667745
Pin: 1993