Wednesday, October 14, 2015

How to set number of suggestions to show with jQuery UI autocomplete

There is no native way to limit results in jQuery UI autocomplete widget. You have two options to achieve your target:
  1. You can limit returned results on the server side.
  2. You can modify results on client side by slicing results array:
$("#autocomplete_input").autocomplete({
    source: function(request, response) {
        var results = $.ui.autocomplete.filter(yourarray, request.term);
        response(results.slice(0, 15));
    }
});

Wednesday, February 25, 2015

Increase Import file size limit in PHPMyAdmin

You need to change the upload_max_filesize, post_max_size parameters in php.ini file, and then you need to restart your server.

Sunday, February 22, 2015

How to check / update cordova android version of a cordova/phonegap project?

The current platform version of a cordova app can be checked by the following command

cordova platform version android
And can be upgraded using the command

cordova platform update android
You can replace android by any of your platform choice like "ios" or some else.

Friday, February 20, 2015

How to Sign and Publish a Phonegap App in the Google Play Store

If you have Finished your Phonegap application and you want to submit it to Google Play Store then you should follow the following steps:

1. Register in Google Developer Console ( https://play.google.com/apps/publish/signup/ ) - $ 25.00
  • After you pay for membership, you will need to wait max 48h to Google finish the transaction, but until then you will be able to create new application, upload you .apk file etc..
2. You must upload the zipaligned .apk file to Play Store.
3. How to zipalign your .apk file with phonegap / cordova?
  • First you must create the myApp .keystore file.
  • Copy myapp.keystore to /platforms/android. Now it’s time to sign the app with the key and create the release version.
  • Open myApp/platforms/android/local.properties (or project.properties) in a text editor.
  • Add these two lines at the end and save, even though it says, “Do not modify this file — YOUR CHANGES WILL BE ERASED!”
  • key.store=myapp.keystore
    key.alias=myapp
4. Still in your /myApp folder in Terminal, run: cordova build android --release You’ll be asked for your password twice and it won’t be obfuscated.

5. Your myApp.apk file is put in /myApp/platforms/android/ant-build/CordovaApp-release.apk. This is the file you rename and upload to Google Play.

How to generate .keystore file?

The signing key is a small file which identifies the creator. It will get built into the .apk file so the developer who built the app can be identified. Since the information in the signing key is all supplied by the developer, it really doesn't provide any security. It will make sure that updates to an app are generated by the same user.

1. Install the Java Development Kit
2. Open a CMD or Terminal session

On Windows, open a cmd window and change directory to
cd c:\Program Files\Java\jdk1.7.0_25\bin


3. Use KeyTool to create the keystore file
Enter this command, replacing 'KitchenSink' with the name of your app.

keytool -genkey -v -keystore myApp.keystore -alias myApp -keyalg RSA -keysize 2048 -validity 10000

The file KitchenSink.keystore has now been created in c:\Program Files\Java\jdk1.7.0_25\bin. If you would like it created elsewhere, replace KitchenSink.keystore with the complete path. i.e.

Here are a few more good blogs which could help you:

Thursday, August 21, 2014

Custom Website vs Mainstream CMS

I have recently found a great article about CMS:

Read the full article here

... If you're thinking about getting a website developed you may have faced this question yourself already -
Should I choose a main stream open source CMS, or should I choose a Custom Website?
Some will shout louder than an ocean liner in a bathroom (I seriously just made that up myself!) that an open source CMS is the way to go. More power to YOU! They are FREE! You can change your developer ANY TIME YOU WANT! There are thousands of modules and extensions developed already so you don't even have to pay for those!

To some degree they are right. On the surface, the above statements are correct. But - and it's a big hairy but... if it's all about YOUR business, and what YOU get out of it, is a free One-Size-Fits-All system all it's cracked up to be?

You see, the minute you want your website to fit your requirements, you need to do some customisation ... which is custom programming ... which is chargeable.

At that point, would you rather have someone doing the custom programming who knows the code for all functionality inside out? Or would you prefer to be paying for someone's time to research into how the code works before they even start customising? Depending on the extension, the developer may not even be able to change anything! ...

Read the full article here

Tuesday, July 29, 2014

High performance PHP application architecture

Limundo/Kupindo websites daily have more than 300 000 visitors which generate 10 million page views per day. During peak hours around 10 000 users are online simultaneously. On the other side, speed, stability and scalability are three main requirements that need to be matched. Currently, Limundo is a self-configurable High Availability system that achieves page loads of under 1s and 99.999% uptime, while manipulating more than 15 TB of data on a monthly basis. This paper describes software and hardware architecture spread over several server clusters hosted in the private cloud, that makes this possible.

Google bug-hunting game helps developers find XSS security flaws

Security researchers and businesses can use a new Google game to find a much-abused vulnerability considered one of the world's top three web security threats.

This security game consists of several levels resembling real-world applications which are vulnerable to XSS - your task will be to find the problem and attack the apps, similar to what an evil hacker might do.

XSS bugs are common because they have a nasty habit of popping up wherever a webapp deals with untrusted input. Our motivation is to highlight common coding patterns which lead to XSS to help you spot them in your code.

Link to game: https://xss-game.appspot.com/


Monday, July 28, 2014

PhoneGap Architecture


Installing & starting with PhoneGap on Windows for cross platform mobile development

Here are a few very useful links for Android / PhoneGap developers:

PhoneGap documentation : http://docs.phonegap.com/en/edge/guide_overview_index.md.html#Overview
Installing & starting with PhoneGap on Windows: http://chrisbitting.com/2014/01/06/installing-starting-with-phonegap-on-windows-for-cross-platform-mobile-development/
Android SDK: http://developer.android.com/sdk/index.html
How to use a Command-Line Interface ( cordova ): http://docs.phonegap.com/en/edge/guide_cli_index.md.html#The%20Command-Line%20Interface
Here you can generate the icons for your App: http://www.gieson.com/Library/projects/utilities/icon_slayer/
This link also could be useful ( Four Ways To Build A Mobile Application ) : http://www.smashingmagazine.com/2014/02/11/four-ways-to-build-a-mobile-app-part3-phonegap/

Here are some links which could be useful if you have a trouble with some parts:

If you try to update the SDK version but you get an error I recommend that you delete the current version of the Eclipse/SDK and download the latest version. It worked for me.

How to set the path and environment variables in Windows: http://www.computerhope.com/issues/ch000549.htm
How to enable debugging on android phone : http://www.groovypost.com/howto/mobile/how-to-enable-usb-debugging-android-phone/