Tuesday, September 27, 2016

Convert All Table TD data into Titlecase with 1 line of code

Lets say.. you receive input from server and that input is unstructured. No proper title case. 


Just like this. 


And You want like this (in just one click or unload )



Here is the code (Copy link is below the screenshot)



Download Full Code From Here

Tuesday, September 20, 2016

How to check a value exists in javascript array

Lets say user send a input "abcd" or "123". Now i want to check that incoming input should be  valid as assign in javascript array.

Like this -:



And you want output like this



var validFormatsArray = ['varchar','email','int','phone','sudhir'];
var isValidFormat = $.inArray('int'.toLowerCase(), validFormatsArray);

if(isValidFormat == -1){
  alert('Invalid format detected');
}else{
  alert('valid format');
}

Checkout this video tutorial







Also Read-:

Top most 15 haunted places in india which will dread your body



Sunday, September 18, 2016

How to translate one word to all possible language in single click

This trick will work in google spreadsheets only.


1) open a blank (new) google docs spreadsheet
2) add this to cell B2:
=GoogleTranslate($A$1, "en", "af")
3) Copy the formula entered into B2 to as many rows you want, one for each language.
4) replace the "af" (afrikaans) with whatever language codes you want in the formulas below B2 ... google has 149 languages to pick from. See here: Google Language Codes - tomihasa
5) Enter the stuff you want translated into cell A1




Saturday, September 17, 2016

How to use google voice in chrome (awesome tricks)

1. How do you turn on voice search on Google Chrome?
2. What is the Voice Search?
3. How do I use voice commands?



must watch and learn how to use effectively google voice in your computer using chrome

Friday, September 16, 2016

World-easiest-profile-management-crud-application-in-symfony



Hey Guys, I developed this application in one of my interview in Mumbai. Later on i feel that, this application can help to lot of developer (not only in core php but all PHP Frameworks i.g Symfony)...
What cover PMCA (Profile Managment CRUD System)

1. Insert Profile Details with Profile Pic (Preview also) using Ajax with required validation

2. Update Existing Record (required validation too)

3. View All Records with pagination by id

4. List all Profile in single page

5. Delete Single Record

6. Api End Point where, if you request ids (,2,5,10). you will get profile details in Json format.


HERE IS FULL CODE (FREE DOWNLOAD)



HERE IS FULL CODE (FREE DOWNLOAD)




Thursday, September 15, 2016

Export Html Table into Excel using Javascript in 2 Minute

Hey guys, Want to export your small/Large Table data with row header in excel.
Also, you want to put some color in first row. then you are in right place.

This code (few lines of code ) will export the same.

No rocket science required.
No external setup
Only Vanilla JavaScript

----------------------------------------------------------


HTML-:

  <table id="exTable" border="1">
    <thead class="lockedRecordsBg">
        <tr>
            <th>S#</th>
            <th>name</th>
            <th>Email</th>
            <th>Phone</th>
            <th>Country</th>
    </thead>
    <tbody>
        <tr>
            <td rel="client">1</td>
            <td rel="regionName">Sudhir K Gupta</td>
            <td rel="date">sudhirgupta.456@gmail.com</td>
            <td rel="shift">+91 89********</td> 
            <td rel="shift">India</td>             
        </tr>
        <tr>
            <td rel="client">2</td>
            <td rel="regionName">Sudhir K Gupta</td>
            <td rel="date">test@gmail.com</td>
            <td rel="shift">+91 89********</td> 
            <td rel="shift">USA</td>             
        </tr>
    </tbody>
</table> 


Javascript-:

<script>
function exportToExcel(tableID){
    var tab_text="<table border='2px'><tr bgcolor='#87AFC6' style='height: 75px; text-align: center; width: 250px'>";
    var textRange; var j=0;
    tab = document.getElementById(tableID); // id of table

    for(j = 0 ; j < tab.rows.length ; j++)
    {

        tab_text=tab_text;

        tab_text=tab_text+tab.rows[j].innerHTML.toUpperCase()+"</tr>";
        //tab_text=tab_text+"</tr>";
    }

    tab_text= tab_text+"</table>";
    tab_text= tab_text.replace(/<A[^>]*>|<\/A>/g, ""); //remove if u want links in your table
    tab_text= tab_text.replace(/<img[^>]*>/gi,""); //remove if u want images in your table
    tab_text= tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); //remove input params

    var ua = window.navigator.userAgent;
    var msie = ua.indexOf("MSIE ");

    if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))      // If Internet Explorer

    {
        txtArea1.document.open("txt/html","replace");
        txtArea1.document.write( 'sep=,\r\n' + tab_text);
        txtArea1.document.close();
        txtArea1.focus();
        sa=txtArea1.document.execCommand("SaveAs",true,"sudhir123.txt");
    }

    else {
       sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));
    }
    
    return (sa);
}
</script>

Now Put button below the script (must) or put jquery window.load function for this click event.
otherwise it will not work.

<input type="button" value="export" onclick="exportToExcel('exTable')" />




Download Code From Here


Ads.


Know top 10 most interesting and awesome YouTube fact

Do you know why are headphones printed L and R

job doesn’t define how good human being you are

5 funny and interesting fact about your jeans






Author-

sudhir k gupta | sudhir gupta | sudhir kumar gupta | eghara
sudhir k gupta | sudhir gupta | sudhir kumar gupta | eghara






Sunday, September 11, 2016

How to see Wi - Fi password of connected network in window 10

Guys, It's very easy to find out the password of connected wi-fi connection. those who are facing Problem. Follow below steps or watch video directly.


1. Head out mouse cursor over Wi-Fi icon
2. Right click and select "Open network and sharing center"
3. Click on connected Wi-Fi connection
4. Click on wireless properties
5. Click on security
6. Check on "show characters"

Now See Network security key.  This is your Wi-Fi password.

Checkout video 


Tuesday, September 6, 2016

bind javascript event for future element without attaching any event - DOMNodeInserted (alternative of .on )

1st approach what we did always 

$('body').on('click','.abcd',function () {
        $(this).prev('.teaseRestText').toggle();
        if ($(this).attr('toggle') == '0') {
            $(this).html('Show Less...').attr('toggle', 1);
        }
        else {
            $(this).html('Show More...').attr('toggle', 0);
        }
});


But sometimes, situation came that we don't have any event like "click " but still need a function to execute for dynamic elements. 

I came to this solution  



$(document).bind('DOMNodeInserted', function(event) {
    $('#table tr').each(function (e) {
        console.log(e);
    });
});