Thursday, September 15, 2011

Free Cloud Hosting Providers for your Apps

minus]align: left;" trbidi="on">Interested in New Technologies but Finding hard to experiment your apps in hosted environment?
Cloud Providers I am Currently Exploring
1. DotCloud [https://www.dotcloud.com/]
  • [plus]Free cloud deployment for apps such as MongoDB, Node.Js, Redis, Ruby, Ruby worker, Python or Solr. 
  • [plus]Can deploy 2 apps with a clean URL.
  • [plus]No Credit Card Needed
  • [minus] command line Interface upload
  • [minus] Linux/cygwin 
  • [plus] Clean URL
2. AWS by Amazon [http://aws.amazon.com/free/]
  • [plus]Most Powerful and Secure
  • [plus]750 hours of Amazon EC2 Linux Micro Instance usage (613 MB of memory and 32-bit and 64-bit platform support) – enough hours to run continuously each month
  • [plus]750 hours of an Elastic Load Balancer plus 15 GB data processing
  • [plus]10 GB of Amazon Elastic Block Storage, plus 1 million I/Os, 1 GB of snapshot storage, 10,000 snapshot Get Requests and 1,000 snapshot Put Requests
  • [plus]5 GB of Amazon S3 standard storage, 20,000 Get Requests, and 2,000 Put Requests and more
  • [plus]Advanced Interface and Monitoring Tools
  • [plus] Support
  • [minus] Credit Card Needed
  • [plus]Can work using Windows/Linux

3. NodeSter [http://nodester.com/]
  • [plus]Free cloud deployment for Node.Js [dedicated]
  • [plus] No Credit Card
  • [minus] Linux/cygwin
4.CloudControl [https://cloudcontrol.com/]
  • [plus] No Credit Card for free account
  • [plus] Advanced Interface and Monitoring Tools
  • [plus] Can work using Windows/Linux
  • [plus] Clean URL

Exploring More....

Wednesday, September 14, 2011

Migrating from Codeigniter1.6 to Codeigniter2.0

If you are document oriented you should go through http://codeigniter.com/user_guide/changelog.html
I am switching to ci v2 here are some problems faced during the migration

Issues faced.
Issue 1:
Class 'MY_Controller' not found in application/controllers/welcome.php on line 3
Solution:
All the instructions say to put your controllers in application/library. Not anymore. You place them in application/core.

Tuesday, September 13, 2011

Writing your Custom Search Chrome Extension

Did you know, all that it takes to develop a Google Chrome Extension is HTML, CSS, JavaScript and an icon. Sounds doable right?

Each extension has the following files:
  • A manifest file
  • One or more HTML files (unless the extension is a theme)
  • Optional: One or more JavaScript files
  • Optional: Any other files your extension needs—for example, image files
Extensions will run as separate processes: one per extension.

  1. Create a folder on your computer and call it CompactSearch. Create a manifest file (text file) inside the folder and call it manifest.json. Add the following contents to the file 
    {
      "name": "CompactSearch",
      "version": "1.0",
      "authors": [ {
          "email": "your_email@address.com",
          "name": "Your Name"
       } ],
      "description": "Search without opening an extra tab",
      "permissions": ["http://*.google.com/"],
      "browser_action": {
        "default_icon": "icon.png",
        "default_title": "Compact Search",
        "popup": "popup.html"
      },
      "icons": {
          "16": "icon_16.png",
          "48": "icon_32.png"
       }
    }
    
  2. Create a file popup.html and create the basic html template. With a div with id "searchResults".
    <html>
      <head>
    
      </head>
      <body>
       <div id="searchResults"></div>
      </body>
    </html> 
    
  3. Get a Custom Search API key from here
  4. Add the following line in the head section replacing API_KEY by your Custom Search API key
    <script src="https://www.google.com/jsapi?key=<API_KEY>" type="text/javascript"></script>
  5. Paste the following code in header
    <script>
    //<![CDATA[
    
    google.load("search", "1");
    
    function fnSearch(sVar) {
    // Create a search control
    var searchControl = new google.search.SearchControl(); 
     
    // Add in a set of custom searchers 
    searchControl.addSearcher(new google.search.ImageSearch());
    searchControl.addSearcher(new google.search.WebSearch());
    searchControl.addSearcher(new google.search.VideoSearch());
    searchControl.addSearcher(new google.search.NewsSearch());
    searchControl.addSearcher(new google.search.BlogSearch());
    
    // Set the Local Search center point
    var drawOptions = new google.search.DrawOptions();
    drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
    searchControl.draw(document.getElementById("searchresult"), drawOptions);
         
    // Execute an inital search
    if (sVar==undefined){
      sVar="India";
    }
    searchControl.execute(sVar);
    }
    google.setOnLoadCallback(fnSearch,"India");
    //]]>
    </script>
    
  6. Load the extension.
    1. Bring up the extensions management page by clicking the wrench icon and choosing Tools > Extensions.
    2. Click the Load unpacked extension button. A file dialog appears.
    3. In the file dialog, navigate to your extension's folder and click OK.
If your extension is valid, its icon appears next to the address bar, and information about the extension appears in the extensions page. Now click on the icon and start searching.
Further Reading:
Hosting an Application

Node.Js Resources

Monday, September 5, 2011

10 Reasons to Use Drupal

Here are 10 reasons why you should seriously be considering Drupal for your SEO-based Web development projects.
  1. Advanced URL Control — Unlike WordPress, Drupal gives you precise control over URL structure. Each item of content in Drupal (called a node) can be given a custom URL (called a URL alias). In WordPress you are generally limited to one type of permalink URL for all posts. You can override the "post slug", but it's much less precise than Drupal's URL aliases. You can also automate custom URL structures for each different content type with the Pathauto Module. The Global Redirect Module will automatically 301 redirect the internal Drupal URL to the custom URL alias. Unlike many other content management systems, Drupal's content pages have nice clean URLs.
  2. Custom Content Types and Views — You can use the Content Construction Kit (CCK) and Views Modules to create new content types and create advanced custom views for them without writing any code. A few examples of "content types" are "blog posts", "news stories", "forum posts", "tutorials", "classified ads", "podcasts". You can create as many custom content types as you would like and display them in many different ways. Most content management systems would require writing code to accomplish these tasks, but there is no programming knowledge required to do them in Drupal. Here is a quick & basic intro to Views called How To Build Flickr in Drupal.
  3. Revision Control — You can configure Drupal to save a new version of your pages every time they are editing. That means that you can go back to view or revert old revisions if you want.
  4. Taxonomy — Drupal has a powerful taxonomy (category) system that allows you to organize and tag content. Each Drupal "vocabulary" (set of categories) can be limited to certain content types. For example, you could have blog contents that allowed free tagging (similar to WordPress categories), while your news section might have a different vocabulary (set of categories) that could only be selected from an existing list of categories. You can also have hierarchical categories, with single or multiple parent categories. Drupal's advanced taxonomy features, combined with CCK and Views, allows you to easily target all of those long-tail keywords that you researched in Wordtracker.
  5. User Management — Drupal was designed for community-based Web sites and has strong user role and access control functionality. You can create as many custom user roles with custom access levels as you need. For example you could create the following roles, each with different levels of access to your features: "anonymous visitor", "authenticated user", "moderator", "editor", "webmaster", "admin". You can keep the advanced user management features (like multiple blogs) turned off if you don't want them, enabling them later if your site grows to a point where you would like to add more community features.
  6. Page Titles and Meta Tags — Drupal's Page Title Module gives you custom control of your HTML <title> elements, while the Meta Tags Module gives you control over your pages' individual meta description tags. This is difficult in some content management systems, but it's easy with Drupal.
  7. Excellent Documentation — Documentation includes the official handbooks, the massive API Reference, numerous tutorials, blogs, videos, and podcasts, and the excellent new book Pro Drupal Development. There is even a Drupal Dojo community where you can learn how to become a Drupal ninja.
  8. PHP Template — Drupal uses the PHP Template theme engine by default. Theming in Drupal is easier than theming in WordPress and doesn't necessarily require any PHP knowledge. Drupal's Theme Developer Guide is a great resource. I also recommend reading Chapter 8 in Pro Drupal Development.
  9. Drupal Cookbooks — If you want a feature that is not built into Drupal by default, chances are that someone has already written a code snippet for it and posted it in the code snippets section of Drupal.org.
  10. Large and Friendly Community — With so many major sites using Drupal, it's not going away soon. For an idea of the size of the developer community, take a look at the long list of community-contributed modules. The Drupal forum is highly active and are a great place to get your Drupal questions answered. You can also find Drupal support on IRC chat on channels #drupal-support and #drupal-dojo. To meet other Drupal users in your area, visit Drupal Groups.


Introduction to Drupal by jwhatcott

To get full size profile picture from facebook

The default profile picture from Facebook API:

Use this link:
http://graph.facebook.com/<user.id>/picture?type=large
(note:without using type variable you will receive a 50x50 image of user)

The Full Size profile picture:

Assumptions

The following scripts assume a couple of things:

Graph API method

The following Graph API method works by doing two API calls: The first requests all the user albums and gets the ID of the album with the name “Profile pictures”, the second gets the first image from that album. Conveniently, the current profile picture is always the first in the returned list.
//Get a list of all the albums FB.api('/me/albums', function (response){ for (album in response.data) { // Find the Profile Picture album if(response.data[album].name == "Profile Pictures"){ // Get a list of all photos in that album. FB.api(response.data[album].id + "/photos", function(response){ //The image link image = response.data[0].images[0].source; }); } } });

FQL method

The FQL method also requires two api calls: one to get the user id, and a second FQL query for that user’s profile picture. You could lower this to one API call if you store the user id sometime earlier.
//get the current user id FB.api('/me', function (response){ /* the FQL query: Get the link of the image, that is the first in the album "Profile pictures" of this user.*/ var query = FB.Data.query('select src_big from photo where pid in (select cover_pid from album where owner={0} and name="Profile Pictures")', response.id); query.wait(function (rows){ //the image link image = rows[0].src_big; }); });