Saturday, May 24, 2014

The Head Section

Tags which are important in head section of your web page,

<meta http-equiv="content-type" content="text/html; charset=UTF-8">  
<meta http-equiv="content-language" content="en-us">
 

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 

<meta http-equiv="Cache-control" content="public">
 
<meta name="robots" content="all"/>
 
<meta name="application-name" content="Website Name"/>
<link rel="canonical" href="current canonical url" />
<link rel="shortcut icon" href="shortcut icon"/>  
 
<meta name="copyright" content="Copyright info"/>
<meta name="author" content="Author Info"/>
 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
 
SEO Fields 
<title>Your Website title</title>  
<meta name="keywords" content="keywords"/>
<meta name="description" content="Page description"/>
<meta property="fb:page_id" content="fb page id" />
 
<!-- dns-prefetch -->
<meta http-equiv="x-dns-prefetch-control" content="on">
<link href="url for your cds" rel="dns-prefetch" />
 
<!-- apple app icons -->
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon" href="/apple-touch-icon-57x57.png" /> 
 
<!-- schema.org -->
<meta itemprop="name" content="Page Name">
<meta itemprop="description" content="Page description">
<meta itemprop="image" content="Logo image/ Image to be shared">
 
<!-- twitter card -->
<meta name="twitter:card" content="Card Name">
<meta name="twitter:url" content="Card URL">
<meta name="twitter:description" content="Card Description">
<meta name="twitter:title" content="Card Title">
<meta name="twitter:image" content="Image to share"> 
 
<!-- facebook open graph -->
<meta property="og:title" content="Open graph title"/>
<meta property="og:description" content="page description"/>
<meta property="og:type" content="type of content"/>
<meta property="og:image" content="Image to be share"/>
<meta property="og:site_name" content="Site name"/>    
<meta property="og:url" content="Site url"/>

Saturday, November 10, 2012

Prototype_legacy_helper for rails > 3.0.9

Prototype_legacy_helper for rails > 3.0.9

Prototype_legacy_helper is available for rails 3 which gives rails 2 legacy support to rails 3 such as form_remote_tag. This plugin is gem for large application which want to migrate to rails 3. But this plugin is using some prototype_helper class functions which is deprecated in rails > 3.0.9. Here I am posting code to make it working for new rails versions in case we want to keep our old form_remote_tag working.

Add following code in vendor/plugins/prototype_legacy_helper/lib/prototype_legacy_helper.rb
1:   CALLBACKS = Set.new([ :create, :uninitialized, :loading, :loaded,  
2:             :interactive, :complete, :failure, :success ] +  
3:             (100..599).to_a)  
4:      
5:   def build_callbacks(options)  
6:    callbacks = {}  
7:    options.each do |callback, code|  
8:     if CALLBACKS.include?(callback)  
9:      name = 'on' + callback.to_s.capitalize  
10:      callbacks[name] = "function(request){#{code}}"  
11:     end  
12:    end  
13:    callbacks  
14:   end  
15:    
16:    
17:   def options_for_ajax(options)  
18:    js_options = build_callbacks(options)  
19:      
20:    js_options['asynchronous'] = options[:type] != :synchronous  
21:    js_options['method']    = method_option_to_s(options[:method]) if options[:method]  
22:    js_options['insertion']  = "'#{options[:position].to_s.downcase}'" if options[:position]  
23:    js_options['evalScripts'] = options[:script].nil? || options[:script]  
24:      
25:    if options[:form]  
26:     js_options['parameters'] = 'Form.serialize(this)'  
27:    elsif options[:submit]  
28:     js_options['parameters'] = "Form.serialize('#{options[:submit]}')"  
29:    elsif options[:with]  
30:     js_options['parameters'] = options[:with]  
31:    end  
32:      
33:    if protect_against_forgery? && !options[:form]  
34:     if js_options['parameters']  
35:      js_options['parameters'] << " + '&"  
36:     else  
37:      js_options['parameters'] = "'"  
38:     end  
39:     js_options['parameters'] << "#{request_forgery_protection_token}=' + encodeURIComponent('#{escape_javascript form_authenticity_token}')"  
40:    end  
41:      
42:    options_for_javascript(js_options)  
43:   end  
44:    
45:   def remote_function(options)  
46:    javascript_options = options_for_ajax(options)  
47:      
48:    update = ''  
49:    if options[:update] && options[:update].is_a?(Hash)  
50:     update = []  
51:     update << "success:'#{options[:update][:success]}'" if options[:update][:success]  
52:     update << "failure:'#{options[:update][:failure]}'" if options[:update][:failure]  
53:     update = '{' + update.join(',') + '}'  
54:    elsif options[:update]  
55:     update << "'#{options[:update]}'"  
56:    end  
57:      
58:    function = update.empty? ?  
59:    "new Ajax.Request(" :  
60:     "new Ajax.Updater(#{update}, "  
61:      
62:    url_options = options[:url]  
63:    function << "'#{html_escape(escape_javascript(url_for(url_options)))}'"  
64:    function << ", #{javascript_options})"  
65:      
66:    function = "#{options[:before]}; #{function}" if options[:before]  
67:    function = "#{function}; #{options[:after]}" if options[:after]  
68:    function = "if (#{options[:condition]}) { #{function}; }" if options[:condition]  
69:    function = "if (confirm('#{escape_javascript(options[:confirm])}')) { #{function}; }" if options[:confirm]  
70:      
71:    return function.html_safe  
72:   end  
73:    



Thursday, December 2, 2010

My KillerMobi

I am basically a simple developer. I love to develop software for mobile. KillerMobi is my latest development in this field, you can download my mobile development through this site. Simple site with most important software for your mobile.

KillerMobi development started on 28th july 2010 and the basic version of the site I prepared in 10 days. KillerMobi domain I purchased on 4th august and from 12th august its online. Thanks to Mr. Sanjay Goel (Co founder Must See India) to suggest me this name.

After that I deeply indulged in developing content for the site and for that I develop Mobile Astrologer and Mobile Number Tracer V1.0 . I launched them along with my old development SnakeWar, SnakeWar dark night and classroom chat app. Mobile astrologer and Mobile number tracer are also available for Blackberry. Check out killermobi.com for more details.

From today Mobile Number Tracer got more than 800000+ download from various apps store like getjar, downloads.com, mobango and ofcource KillerMobi. I got more than 4000 missing code submissions from around the globe. Mobile astrologer is also running well with more than 10000+ downloads.

From this open heart acceptance of Mobile Number Tracer, I am planning to develop new version of Mobile Number Tracer with more updated database and new features and this time this will available for android and iphone(expected) as well.

So keep in touch with KillerMobi and also with me...

Rishabh Tripathi
rishabh@killermobi.com