Compressing Javascript

February 8th, 2008 Marcel Duran Posted in Javascript, Useful Stuff No Comments »

The compression of Javascript source codes (a.k.a Minification) is the practice of removing unnecessary characters from the original source code, usually comments, white spaces, line breaks and block delimiters without changing its functionality. Once the code is well minified its file size is reduced improving the download time and thereby reducing the time needed to load it on client and the usage of bandwidth.

Minification is an easy and safe practice and there are several tools that helps you on this task. The most popular are:

Obfuscation is a similar technique which besides code reduction also changes the functions and variables names making the code harder to read and making the reverse engineer more difficult (not impossible though), however the use of this technique is more likely to generate bugs and make the code harder to debug, so use it carefully.

The Javascript Compressor online tool has an optional obfuscation parameter which besides minification also obfuscate the source code with 3 different encodings.

AddThis Social Bookmark Button

Javascript Regular Expression Online Tester

February 7th, 2008 Marcel Duran Posted in Javascript, Useful Stuff No Comments »

RegexPal is an online web-based tool to test javascript regular expressions. It is a very handy tool developed by Steven Levithan that helps you to test regular expressions when you are developing your applications, saving some precious time when you just need to check if any regular expression is doing what you expect it to do.

To use RegexPal is straightforward:

  • Just open www.regexpal.com in your favorite browser
  • Enter the regular expression to test in the top box
  • Enter some test data in the largest box

As you enter either the regular expression or the data to test you will get the matches highlighted in colors in the largest box.

It also comes with a regular expression quick reference guide on the top right, just move the mouse pointer over to open it.

Next time you think about creating a simple application to test your regular expressions, try RegexPal first.

AddThis Social Bookmark Button

Credit Card Test Numbers

February 6th, 2008 Marcel Duran Posted in Useful Stuff 1 Comment »

Whenever you are developing a billing process form for an e-commerce web site or similar application you always face the annoyance of testing your applications with valid numbers and hence you have to put real credit card numbers in order to test them against the credit card systems. It works well when you have in hand all the credit card types and have a way to cancel those test payments, however it might be risky when you are not under a secure host yet, usually when your application is still under development.Fortunately there are several fake credit card numbers with valid checksums. They are really useful when testing your applications forms, but as they are fake you are not able to buy anything nor test an approved transaction simulation against a real credit card system. These numbers don’t even have security codes.

American Express
378282246310005
VISA
4111111111111111
Mastercard
5555555555554444
Diners Club
30569309025904
Discover
6011111111111117
JCB
3530111333300000

Source: Paypal - Test Credit Card Account Numbers

AddThis Social Bookmark Button