Bits N Tricks

A platform to contribute to the best of our knowledge so someone else can be benefited.

Color Picker – jQuery plugin 08Jan, 2011

Color Picker – jQuery plugin

About A simple component to select color in the same way you select color in Adobe Photoshop Features Flat mode – as element in page Powerful controls for color selection Easy to customize the look by changing some images Fits into the viewport Examples Flat mode. $(‘#colorpickerHolder’).ColorPicker({flat: true}); Custom skin and using flat mode to display the color picker in a custom widget. Attached to an text field and using callback functions to update the color with field’s value and set the value back in the field by submiting the color. $(‘#colorpickerField1, #colorpickerField2, #colorpickerField3’).ColorPicker({ onSubmit: function(hsb, hex, rgb, el) { $(el).val(hex); $(el).ColorPickerHide(); }, onBeforeShow: function () { $(this).ColorPickerSetColor(this.value); } }) .bind(‘keyup’, function(){ $(this).ColorPickerSetColor(this.value); }); Attached to DOMElement and using callbacks…

Posted in: JQuery
Cakephp – Logable behaviour 31Dec, 2010

Cakephp – Logable behaviour

This behavior is created to easily let you (the developer) log users activities that relates to database modifications (ie, add, edit and delete). If you just want to see what your users are doing or need to be able to say “That is not a bug, I can see from my log that you deleted the post yesterday.” and don’t want to spend more time that it takes to do “var $actsAs = array(‘Logable’);” then this behavior is for you.

Posted in: Cakephp
Make yourself globalize with the help of Seo content writing 31Dec, 2010

Make yourself globalize with the help of Seo content writing

How to directly interact with Search engines eg: (google, The more knowledge you have about your product make you more globalize. Write a few lines about what is product or information all about. Followings are the few steps. 1) “Bold” the portion which tells brief about the product. 2) Highlight that portion which is most important. 3) Use some keywords in your text that can help you to achieve high rank on google search engine. Example: If you are talking about the facebook connect write some content about facebook connect in the introduction part like (save your valuable time by direct connect with facebook connect) facebook is most common word hit by the user now a days. If you use…

Posted in: SEO
jQuery validation on create account page in oscommerce 31Dec, 2010

jQuery validation on create account page in oscommerce

Jquery validation contribution for create account page validations in oscommerce.You can download contribution from oscommerce website. JQuery Validation On Create Account Page IF oscommerce-2.2rc2a Freash installation then copy all files otherwise follow follwing instructions. ******************** *** INSTALLATION *** ******************** 1. backup your create_account.php file ******************** 2. Add Following Files:- css/jquery.validate.css js/jquery-1.3.2.js js/jquery.validate.js js/jquery.validation.functions.js ************************** 2. Modified create_account.php :- Add folowing code in head tag-> 3. Find tep_draw_radio_field(‘gender’, ‘m’) changes to tep_draw_radio_field(‘gender’, ‘m’,”,’id=”genderm”‘) 4. Find tep_draw_radio_field(‘gender’, ‘f’) changes to tep_draw_radio_field(‘gender’, ‘f’, ”,’id=”genderf”‘) 5. Find tep_draw_input_field(‘firstname’) changes to tep_draw_input_field(‘firstname’,”,’id=”firstname”‘) 6. Find tep_draw_input_field(‘lastname’) changes to tep_draw_input_field(‘lastname’,”,’id=”lastname”‘) 7. Find tep_draw_input_field(‘dob’) changes to tep_draw_input_field(‘dob’,”,’id=”dob”‘) 8. Find tep_draw_input_field(’email_address’) changes to tep_draw_input_field(’email_address’,”,’id=”email_address”‘) 9. Find tep_draw_input_field(‘street_address’) changes to tep_draw_input_field(‘street_address’,”,’id=”street_address”‘) 10. Find tep_draw_input_field(‘postcode’) changes to tep_draw_input_field(‘postcode’,”,’id=”postcode”‘) 11. Find tep_draw_input_field(‘city’)…

Posted in: OsCommerce
Facebook Connect in Php 30Dec, 2010

Facebook Connect in Php

Facebook Connect in PHP,Just Follow these Steps :- Upload all the files of zip folder on server.(Attached with this post) Step 1 : Just open the file where you have to use facebook connect.(e.g abc.php) Step 2: Just include this javascript file in head :- “<script src=”” type=”text/javascript”></script>”. Step 3: Include the file “facebook.php”(Uploaded with this post). Step 4: To put login button of facebook connect :- <fb:login-button onlogin=’window.location=””;’ size=”medium” background=”white” ></fb:login-button> Step 5: create the object :- $facebook = new Facebook(‘Facebook API key’,’Facebook App Secret Key’,true); Step 6: To get the user id of facebook login person:- “$fUserId = $facebook->get_loggedin_user();” Step 7: To get the session key for the api -> $fc = new FacebookRestClient(‘facebook Api keyApi secret key’,$facebook->api_client->session_key);…

Posted in: PHP
Install Mac on normal machine 28Dec, 2010

Install Mac on normal machine

Introduction There are thousands of Computer Users who would always dream to own a Mac and this is not just for the beautiful looks or the powerful hardware but for the Operating System OS X which is one of the reason Apple is selling their products in large numbers. Now its quite possible for anyone to install a Mac OS X Snow Leopard the latest OS from Apple on their normal computers powered with Windows or Linux. Here are few of the reasons why you would be looking to perform this job. 1.Mac is a operating system which is less prone to viruses. 2.High graphics Steps for installing Mac on a normal Machine. Things you need for starting the installation…

Posted in: Security, Windows