Menu

Friday, March 15, 2013

JQuery UI resizable layout


I've created a plugin for jquery ui that enables developers to create layouts that can be resized by the users, and brings a more functional frontend design.
You will need git to download it. The repository url is https://github.com/lexmihaylov/jquery.ui.layout

Object Oriented JavaScript Using JQuery

Javascript becomes more and more popular these days, and what best way to write reusable code if not writing it the OO style. JS is not your tipical programming language, the classes in js are not actualy classes, but funcions. Every function has a prototype object that contains methods and properties, we can use this object to write javascript classes.
1. Creating a JS Class:
To create a js class you need to create a function and after that you can use the this keyword to access the object's properties and methods.

Using compression in REST communication between applications

When you are working on a large project, there are alot of situations that the project is composed of more than one application. The problem here is how to solder everything together. There are alot of ways you can handle communication between applications, for example you can use XML, JSON, HTTP Requests, etc. If you are using PHP for building your project maybe the easiest way of handling communication is by using JSON.
There are two buildin function that you need to look at before starting:
We will use these two functions to serializing and deserializing the data that we need to send between applications.

Tuesday, November 6, 2012

Securing your data using PHP and OpenSSL


I saw that there wasn’t alot of information on the internet about how to encrypt data in your web application using php an openssl, so here it is.
First of all you need to understand how ssl connections works. If you already know that just skip this part:
The secured socket layer or ssl has many applications, but mostly it is used for creating an encrypted data tunnel between two remote machines.
1. The client application sends a handshake request to the remote server;
2. The server sends the ssl certificate information along with his public key;
3. The client application checks the hostname, expiration date, and authority registration of the certificate, and if some of these parameters is not met then a warning message is displayed to the user.
4. After receiving the public key form the server the client application generates an envelope key that is used to encrypt the data transfer between the two machines. This key is then encrypted with the server’s public key and send back to the server.
5. The envelope key can be decrypted only with the private key that server has.
6. After both machines have the envelope the data transfer can begin.