CSS padding Property

CSS, Web
The CSS padding properties define the space between the element border and the element content. The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element. The top, right, bottom, and left padding can be changed independently using separate properties. A shorthand padding property can also be used, to change all paddings at once. Possible ValuesDescription lengthDefines a fixed padding (in pixels, pt, em, etc.) %Defines a padding in % of the containing element Negative values are not allowed. Padding all sides equally In CSS, it is possible to specify one padding value for all sides: [crayon-5adad0a19867a508189622/] Padding individual sides In CSS, it is possible to specify different padding for different sides: [crayon-5adad0a198682009390033/] This can however…
Read More

How to create a new Sinopia user

JavaScript, Web
This tutorial will show you how to create a new Sinopia user. In a previous tutorial we saw how to setup a private NMP repository with Sinopia. Now we will see how to create a new Sinopia user in that private repository. You can easily create a user both on the server and on the client by issuing this command: [crayon-5adad0a198ebd063770319/] Change the host and port appropriately. On the next prompt: specify the name and the password (twice). Next you can specify an email address to be used for notifications. Press enter to complete the user registration. You can find the list of users and their hashed passwords in the htpasswd file which is located in the root folder of the Sinopia installation. The newly created user cannot publish to…
Read More

How to setup a private NPM repository with Sinopia

JavaScript, Web
This tutorial shows you how to setup a private NPM repository server with Sinopia in 4 easy steps. [caption id="attachment_629" align="alignnone" width="274"] sinopia on NPM[/caption] Sinopia is a private/caching NPM repository server. It allows you to have a local NPM registry with zero configuration. 1. Installation and Initial Configuration of Sinopia on a server Make sure you have nodejs installed on your server. On your server create a folder called sinopia. Open a shell in this folder and type [crayon-5adad0a19976f339786441/] From this new directory, start Sinopia to build the initial configuration file. On initial startup in an empty directory, the output will resemble the following: [crayon-5adad0a199776922261859/] Note that the server is running and you should be able to access it at http://localhost:4873. Unless you want to use this Sinopia server…
Read More

How to enable the web interface in Sinopia

NPM, Web
This tutorial will show you how to enable the web interface in Sinopia. The web interface in Sinopia is a work-in-progress , though it is already usable. In a previous tutorial we saw how to setup a private NMP repository with Sinopia. Now we will see how to enable the web interface in Sinopia. Try accessing the web interface After installing the Sinopia server we can immediately access the web interface. If you navigate to http://localhost:4873/ you will see a message like: [crayon-5adad0a19a14b685794209/] Enable the web interface In order to enable the web interface we need to change the following setting to the config.yaml file which is located in the root of the Sinopia installation. Scroll to a section named the web and set enabled to true. [crayon-5adad0a19a151300945441/] After you…
Read More

How to round a double

Java
This code snippet shows how to round a double using the setScale() method of BigDecimal class: [crayon-5adad0a19b242562741469/] Prints: [crayon-5adad0a19b249028694132/]
Read More

How to improve your Google rank

Web
This tutorials provides some insight in how to improve your Google page rank. 1. Pool your referrals. Often business owners don’t realize that http://www.yourdomain.com and http://yourdomain.com are seen as different pages by search engines. This can result in any links that you receive being diluted between the two pages. The solution to this common problem is to tell Google that you want all the votes from http://yourdomain.com to be counted towards http://www.yourdomain.com. This can be easily implemented by using a permanent (known as a 301) redirect from one of the pages to the other. In order to redirect all of the requests for http://yourdomain.com to http://www.yourdomain.com, you should set the appropriate rewrite rule. This can be done by adding the following lines at the beginning of the .htaccess file in…
Read More

Watch any member of an object or a list.

AngularJS, JavaScript, Web
If you watch a list or an object with the objectEquality parameter not set, then the $watch callback function won’t be triggered if the object is only updated partially. [crayon-5adad0a19bfbe918464921/] Setting the objectEquality parameter to true will trigger the $watch callback function on modification of any member. [crayon-5adad0a19bfc5349935879/] Using this the objectEquality parameter has performance impact, so use carefully.
Read More