Menu

Showing posts with label web development. Show all posts
Showing posts with label web development. Show all posts

Sunday, February 16, 2014

Is NodeJS the best solution for your project

Ever since all the commotion around NodeJS started, I was wondering, if javascript is really good for backend development. So I started looking up various subjects regarding NodeJS, like how to configure a production server, benchmarks and others. After doing some reading I was able to form an opinion.

Thursday, February 13, 2014

CSS class generator using SASS

Sass give us a lot of flexibility when we are building big web apps. One of my favorite function is to be able to create css classes by using a loop:


@mixin zoom($scale) {
    $scale: $scale / 100;
    -webkit-transform-origin: 50% 0;
    -moz-transform-origin: 50% 0;
    -ms-transform-origin: 50% 0;
    -o-transform-origin: 50% 0;
    transform-origin: 50% 0;
    
    -webkit-transform: scale($scale);
    -moz-transform: scale($scale);
    -ms-transform: scale($scale);
    -o-transform: scale($scale);
    transform: scale($scale);
}

$zoomFactor: 100;
@while $zoomFactor >= 20 {
    .zoom-#{$zoomFactor} {
        @include zoom($zoomFactor);
    }
    $zoomFactor: $zoomFactor - 10;
}

Create a jquery extension for handling dom insert events

Very often when I'm building a web application, I need to dynamically create some objects and append them to the dom. Well thats ok, but if there are some additional calculations that you need to do after inserting your objects, then things are getting a bit messy. For example you need to position your objects according to a relative parent object's dimensions or initialize a plugin that requires your object to appended to the dom.  Well there is always a way of getting around issues like that, but I wanted to keep thing simple and to do that I needed some king of "onDomInsert" event.


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.