Tuesday, 23 May 2017

Create multi language file in wordpress

#######define Constant in wp-config.php file ######
define ('WPLANG', 'en_US');

#####add code in function.php######
function my_child_theme_locale() {
   load_child_theme_textdomain( 'framework', get_stylesheet_directory() . '/languages' );

add_action( 'after_setup_theme', 'my_child_theme_locale' );

####create mo file in wordpress commond###########
msgcat default.po | msgfmt -o languages/en_US.mo -

Monday, 17 April 2017

add ip for phpmyadmin

/etc/phpmyadmin$ sudo vim config.inc.php
/* Advance to next server for rest of config */
    $cfg['Servers'][$i]['verbose'] = 'Anil DB Magic2';
    $cfg['Servers'][$i]['host'] = 'XXX.XXX.X.XXX';
    $cfg['Servers'][$i]['port'] = '';
    $cfg['Servers'][$i]['socket'] = '';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['AllowNoPassword'] = false;

Monday, 27 March 2017

ckeditor for multiple id

var editor_config = {
    toolbar: [
        {name: 'basicstyles', items: ['Bold', 'Italic']},
        {name: 'paragraph', items: ['BulletedList']}
    width: "210px",
    height: "140px"

CKEDITOR.replace('dsi3', editor_config );
CKEDITOR.replace('dsi4', editor_config );
CKEDITOR.replace('dsi5', editor_config );
CKEDITOR.replace('dsi6', editor_config );

Wednesday, 28 December 2016

footer alway on bottom


  $(document).ready(function() {

   var docHeight = $(window).height();
   var footerHeight = $('footer').height();
   var footerTop = $('footer').position().top + footerHeight;

   if (footerTop < docHeight) {
    $('footer').css('margin-top', 10+ (docHeight - footerTop) + 'px');

Saturday, 24 September 2016

what happens when you type in a URL in browser

In an extremely rough and simplified sketch, assuming the simplest possible HTTP request, no proxies, IPv4 and no problems in any step:
  1. browser checks cache; if requested object is in cache and is fresh, skip to #9
  2. browser asks OS for server's IP address
  3. OS makes a DNS lookup and replies the IP address to the browser
  4. browser opens a TCP connection to server (this step is much more complex with HTTPS)
  5. browser sends the HTTP request through TCP connection
  6. browser receives HTTP response and may close the TCP connection, or reuse it for another request
  7. browser checks if the response is a redirect or a conditional response (3xx result status codes), authorization request (401), error (4xx and 5xx), etc.; these are handled differently from normal responses (2xx)
  8. if cacheable, response is stored in cache
  9. browser decodes response (e.g. if it's gzipped)
  10. browser determines what to do with response (e.g. is it a HTML page, is it an image, is it a sound clip?)
  11. browser renders response, or offers a download dialog for unrecognized types

Friday, 23 September 2016

send tceditor data with ajax

                 for ( instance in CKEDITOR.instances ) {

Thursday, 18 August 2016

python first webapp program

1 - create folder : mkdir myfirstapp
2-  pip install lpthw.web (install commond)
3 . create init file ( touch __init__.py)
4. create app file
    vim app.py
import web

urls = (
  '/', 'index'

app = web.application(urls, globals())

class index:
    def GET(self):
        greeting = "Hello World"
        return greeting

if __name__ == "__main__":

5 - save file and run
python app.py

open webbrowser
put on url :-localhost:8080
Output :-
Hello World