<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>eXpand yOur cReativity &#187; Bhushan Ahire</title>
	<atom:link href="http://blog.bhushangahire.net/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bhushangahire.net</link>
	<description></description>
	<lastBuildDate>Thu, 05 Jan 2012 07:17:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Setup script to get Ruby and Rails running on Ubuntu with one command using RailsReady</title>
		<link>http://blog.bhushangahire.net/2011/12/05/setup-script-to-get-ruby-and-rails-running-on-ubuntu-with-one-command-using-railsready/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setup-script-to-get-ruby-and-rails-running-on-ubuntu-with-one-command-using-railsready</link>
		<comments>http://blog.bhushangahire.net/2011/12/05/setup-script-to-get-ruby-and-rails-running-on-ubuntu-with-one-command-using-railsready/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 10:29:26 +0000</pubDate>
		<dc:creator>Bhushan Ahire</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[railsready]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=302</guid>
		<description><![CDATA[How would you like to get a full Ruby on Rails stack up on Ubuntu with one command? Now you can by running Rails Ready. Rails Ready is a setup script that gets Ruby and Rails running on a fresh install of Ubuntu with one command (Tested on Ubuntu server 10.04 LTS (Long-term Support)). This [...]]]></description>
			<content:encoded><![CDATA[<div class="description">
<p>How would you like to get a full Ruby on Rails stack up on Ubuntu with one command?</p>
<p>Now you can by running Rails Ready. Rails Ready is a setup script that gets Ruby and Rails running on a fresh install of <a target="_blank" class="link external" href="http://www.ubuntu.com/">Ubuntu</a> with one command (Tested on Ubuntu server 10.04 LTS (Long-term Support)).</p>
<p>This is a brand new project by <a target="_blank" class="link external" href="https://github.com/joshfng">Josh Frye</a> that he uses all the time to setup VMs, but there’s always testing to be done and improvements to be made. </p>
<h3>Running the&nbsp;Script</h3>
<p>Check out <a target="_blank" class="link external" href="https://github.com/joshfng/railsready/blob/master/railsready.sh">railsready.sh</a> to see everything Rails Ready is doing.</p>
<pre class="brush: ruby">
  sudo wget --no-check-certificate https://github.com/joshfng/railsready/raw/master/railsready.sh &amp;amp;amp;&amp;amp;amp; bash railsready.sh
</pre>
<p>The script will then ask if you want to build Ruby from source or install RVM. If you want to watch the magic happen just run <code>tail -f ~/railsready/install.log</code>.</p>
<h3>What gets installed?</h3>
<ul>
<li>An updated system (Linux only)</li>
<li>Homebrew (OSX only)</li>
<li>Ruby 1.9.3 latest patch level (installed to /usr/local/bin/ruby) or RVM running 1.9.3 latest patch level</li>
<li>Imagemagick</li>
<li>libs needed to run Rails (sqlite, mysql, etc)</li>
<li>Bundler, Passenger, and Rails gems</li>
<li>Git</li>
</ul>
<p>All you need to do is install <a target="_blank" class="link external" href="http://nginx.org/">NGINX</a> or <a target="_blank" class="link external" href="http://www.apache.org/">Apache</a>, run <code>passenger-install-nginx-module</code> or <code>passenger-install-apache-module</code>, upload your app, point your vhost config to your apps public directory and go!</p>
<p>A note about RVM+passenger+nginx: Passenger installed via RVM can&#8217;t locate the OpenSSL package installed on Ubuntu. A user contributed fix is as follows:</p>
<pre class="brush: ruby">
rvm remove 1.9.2
rvm package install openssl
rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr
rvmsudo passenger-install-nginx-module
</pre>
<p>Hope this guide will be helpful to you.
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2011/12/05/setup-script-to-get-ruby-and-rails-running-on-ubuntu-with-one-command-using-railsready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Code Snippets and Detailed Tutorials</title>
		<link>http://blog.bhushangahire.net/2011/08/03/wordpress-code-snippets-and-detailed-tutorials/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-code-snippets-and-detailed-tutorials</link>
		<comments>http://blog.bhushangahire.net/2011/08/03/wordpress-code-snippets-and-detailed-tutorials/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 07:18:15 +0000</pubDate>
		<dc:creator>Bhushan Ahire</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=287</guid>
		<description><![CDATA[Useful WordPress Tips,Tricks and Hacks Show WordPress Child Pages Alongside Parent Page This goes in your page template or sidebar template where you want your submenu to appear. It is outside the loop. post_parent); if($post-&#38;gt;post_parent) $children = wp_list_pages(&#38;quot;title_li=&#38;amp;child_of=&#38;quot;.$post-&#38;gt;post_parent.&#38;quot;&#38;amp;echo=0&#38;quot;); else $children = wp_list_pages(&#38;quot;title_li=&#38;amp;child_of=&#38;quot;.$post-&#38;gt;ID.&#38;quot;&#38;amp;echo=0&#38;quot;); if ($children &#38;amp;&#38;amp; is_page()) { ?&#38;gt; &#38;lt;div class=&#38;quot;subnav&#38;quot;&#38;gt; &#38;lt;ul&#38;gt; &#38;lt;li&#38;gt;&#38;lt;a href=&#38;quot;&#38;lt;?php echo get_permalink($post-&#38;gt;post_parent) [...]]]></description>
			<content:encoded><![CDATA[<h2>Useful WordPress Tips,Tricks and Hacks</h2>
<p><br/></p>
<h3>Show WordPress Child Pages Alongside Parent Page</h3>
<p>This goes in your page template or sidebar template where you want your submenu to appear. It is outside the loop.</p>
<pre class="brush: php">
post_parent);
if($post-&amp;gt;post_parent)
$children = wp_list_pages(&amp;quot;title_li=&amp;amp;child_of=&amp;quot;.$post-&amp;gt;post_parent.&amp;quot;&amp;amp;echo=0&amp;quot;); else
$children = wp_list_pages(&amp;quot;title_li=&amp;amp;child_of=&amp;quot;.$post-&amp;gt;ID.&amp;quot;&amp;amp;echo=0&amp;quot;);

if ($children &amp;amp;&amp;amp; is_page()) { ?&amp;gt;
&amp;lt;div class=&amp;quot;subnav&amp;quot;&amp;gt;
    &amp;lt;ul&amp;gt;
        &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;lt;?php echo get_permalink($post-&amp;gt;post_parent) ?&amp;gt;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
    &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&amp;lt;a href=&amp;quot;http://vonlind.com/2011/04/show-wordpress-child-pages-alongside-parent-page/&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;Source&amp;lt;/a&amp;gt;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;h3&amp;gt;How To Move  the Admin Bar to the Bottom&amp;lt;/h3&amp;gt;
&amp;lt;p&amp;gt;Copy and paste this code and place it on your functions.php&amp;lt;/p&amp;gt;

[sourcecode language=&amp;quot;php&amp;quot;]
// move admin bar to bottom
function fb_move_admin_bar() { ?&amp;gt;
&amp;lt;!--
    body {
        margin-top: -28px;
        padding-bottom: 28px;
    }
    body.admin-bar &amp;lt;a href=&amp;quot;http://search.twitter.com/search?q=%23wphead&amp;quot; class=&amp;quot;tweet-hashtag&amp;quot;&amp;gt;#wphead&amp;lt;/a&amp;gt; {
        padding-top: 0;
    }
    body.admin-bar &amp;lt;a href=&amp;quot;http://search.twitter.com/search?q=%23footer&amp;quot; class=&amp;quot;tweet-hashtag&amp;quot;&amp;gt;#footer&amp;lt;/a&amp;gt; {
        padding-bottom: 28px;
    }
    &amp;lt;a href=&amp;quot;http://search.twitter.com/search?q=%23wpadminbar&amp;quot; class=&amp;quot;tweet-hashtag&amp;quot;&amp;gt;#wpadminbar&amp;lt;/a&amp;gt; {
        top: auto !important;
        bottom: 0;
    }
    &amp;lt;a href=&amp;quot;http://search.twitter.com/search?q=%23wpadminbar&amp;quot; class=&amp;quot;tweet-hashtag&amp;quot;&amp;gt;#wpadminbar&amp;lt;/a&amp;gt; .quicklinks .menupop ul {
        bottom: 28px;
    }

--&amp;gt;
// on backend area
add_action( &#039;admin_head&#039;, &#039;fb_move_admin_bar&#039; );
// on frontend area
add_action( &#039;wp_head&#039;, &#039;fb_move_admin_bar&#039; );
</pre>
<p><strong><a href="http://wptricks.net/how-to-move-move-the-admin-bar-to-the-bottom/" target="_blank">Source</a></strong></p>
<h3>How To Make Your WordPress Post Look Nice When Shared On Facebook (Updated)</h3>
<p>The code allows you to set the “Featured Image” as the the image that Facebook shows when your link is shared. Secondly, it allows you to set a default image, in case your post does not make use of a “featured image”.You can use your logo for this default, by saving it in your themes directory, in a /images/ directory with the file name as default_icon.jpg. Or you can alter the image directory in the code below.</p>
<pre class="brush: php">
ID,&#039;_thumbnail_id&#039;,false);
	$thumb = wp_get_attachment_image_src($thumb[0], false);
	$thumb = $thumb[0];
	$default_img = get_bloginfo(&#039;stylesheet_directory&#039;).&#039;/images/default_icon.jpg&#039;;

	?&amp;gt;

	&amp;quot; /&amp;gt;
</pre>
<p><strong><a href="http://vonlind.com/2010/10/how-to-make-your-wordpress-post-look-nice-when-shared-on-facebook/" target="_blank">Source</a></strong></p>
<h3>How To Add More Button on Visual Mode WordPress Editor</h3>
<p>Open functions.php on your current theme using your favorite editor and add this code</p>
<pre class="brush: php">
function add_more_buttons($buttons) {
$buttons[] = &#039;hr&#039;;
$buttons[] = &#039;del&#039;;
$buttons[] = &#039;sub&#039;;
$buttons[] = &#039;sup&#039;;
$buttons[] = &#039;fontselect&#039;;
$buttons[] = &#039;fontsizeselect&#039;;
$buttons[] = &#039;cleanup&#039;;
$buttons[] = &#039;styleselect&#039;;
return $buttons;
}
add_filter(&amp;quot;mce_buttons_3&amp;quot;, &amp;quot;add_more_buttons&amp;quot;);
</pre>
<p><strong><a href="http://wptricks.net/how-to-add-more-button-on-visual-mode-wordpress-editor/" target="_blank">Source</a></strong></p>
<h3>How To Automatically Add FTP Detail on WordPress</h3>
<p>Open your wp-config.php and add this code</p>
<pre class="brush: php">
define(&#039;FTP_HOST&#039;, &#039;Your_FTP_Hosting&#039;);
define(&#039;FTP_USER&#039;, &#039;Your_FTP_Username&#039;);
define(&#039;FTP_PASS&#039;, &#039;Your_FTP_Password);
//If you use SSL connection, set this to true
define(&#039;FTP_SSL&#039;, false);
</pre>
<p><strong><a href="http://wptricks.net/how-to-automatically-added-ftp-detail-on-wordpress/" target="_blank">Source</a></strong></p>
<h3>How to Change WordPress Editor Font</h3>
<p>Paste the following code to your function.php file</p>
<pre class="brush: php">
add_action( &#039;admin_head-post.php&#039;, &#039;devpress_fix_html_editor_font&#039; );
add_action( &#039;admin_head-post-new.php&#039;, &#039;devpress_fix_html_editor_font&#039; );

function devpress_fix_html_editor_font() { ?&amp;gt;
&amp;lt;!--
#editorcontainer #content, #wp_mce_fullscreen { font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, &amp;quot;Bitstream Charter&amp;quot;, Times, serif; }
--&amp;gt;
</pre>
<p><span style="font-size: small;"><strong><a href="http://www.wprecipes.com/how-to-change-wordpress-editor-font-2" target="_blank">Source</a></strong></span></p>
<p>&nbsp;</p>
<h3>How to Remove the “read more” Jump</h3>
<p>Paste the below code in your functions.php file</p>
<pre class="brush: php">
function wdc_no_more_jumping($post) {
     return &#039;&amp;lt;a class=&amp;quot;read-more&amp;quot; href=&amp;quot;&#039;.get_permalink($post-&amp;gt;ID).&#039;&amp;quot;&amp;gt;&#039;.&#039;Continue Reading&#039;.&#039;&amp;lt;/a&amp;gt;&#039;;
}
add_filter(&#039;excerpt_more&#039;, &#039;wdc_no_more_jumping&#039;);
</pre>
<p><strong><a href="http://www.wprecipes.com/how-to-remove-the-read-more-jump" target="_blank">Source</a></strong></p>
<h3>Use Shortcodes in Widgets</h3>
<p>Paste the following code to your functions.php file</p>
<pre class="brush: php">
// shortcode in widgets

      if ( !is_admin() ){

          add_filter(&#039;widget_text&#039;, &#039;do_shortcode&#039;, 11);

      }
</pre>
<p><strong><a href="http://wpshout.com/wordpress-functions-php" target="_blank">Source</a></strong></p>
<h3>How to Add a New link to the WP Admin Bar and Remove an Existing Link.</h3>
<p>Simply add this code to your functions.php file</p>
<pre class="brush: php">
remove_menu(&#039;comments&#039;);
    // or we can remove a submenu, like New Link.
    $wp_admin_bar-&amp;gt;remove_menu(&#039;new-link&#039;, &#039;new-content&#039;);
    // we can add a submenu item too
    $wp_admin_bar-&amp;gt;add_menu( array(
        &#039;parent&#039; =&amp;gt; &#039;new-content&#039;,
        &#039;id&#039; =&amp;gt; &#039;new_media&#039;,
        &#039;title&#039; =&amp;gt; __(&#039;Media&#039;),
        &#039;href&#039; =&amp;gt; admin_url( &#039;media-new.php&#039;)
    ) );
}
// and we hook our function via
add_action( &#039;wp_before_admin_bar_render&#039;, &#039;mytheme_admin_bar_render&#039; );
?&amp;gt;
</pre>
<p>Here are some IDs for the default links WP 3.1 adds, found in /wp-includes/admin-bar.php:</p>
<p><strong>my-account / my-account-with-avatar</strong> : the first link, to your account. Note that the ID here changes depending on if you have Avatars enabled or not.</p>
<p>
    <strong>my-blogs</strong> : the ‘My Sites’ menu if the user has more than one site</p>
<p>
    <strong>get-shortlink </strong>: provides a Shortlink to that page</p>
<p>
    <strong>edit</strong> : link to Edit [content-type]</p>
<p>
    <strong>new-content</strong> : the ‘Add New’ dropdown</p>
<p>
    <strong>comments</strong> : the ‘Comments’ dropdown</p>
<p>
    <strong>appearance</strong> : the ‘Appearance’ dropdown</p>
<p>
    <strong>updates</strong> : the ‘Updates’ dropdown</p>
<p><strong><a href="http://wp-snippets.com/1008/addremove-wp-admin-bar-links/" target="_blank">Source</a></strong></p>
<h3>How to Disable Self Trackbacks</h3>
<p>Paste the following code to your functions.php file</p>
<pre class="brush: php">

function disable_self_ping( &amp;amp;$links ) {
    foreach ( $links as $l =&amp;gt; $link )
        if ( 0 === strpos( $link, get_option( &#039;home&#039; ) ) )
            unset($links[$l]);
}
add_action( &#039;pre_ping&#039;, &#039;disable_self_ping&#039; );
</pre>
<p><strong><a href="http://wp-snippets.com/1749/disable-self-trackbacks/" target="_blank">Source</a></strong></p>
<p>&nbsp;</p>
<h3>How to Display Most Commented Posts of Specific Year Without Plugin</h3>
<p>Paste the following code in the sidebar.php or where ever you want</p>
<pre class="brush: php">
&amp;lt;ul&amp;gt;
get_results(&amp;quot;SELECT comment_count,ID,post_title, post_date FROM $wpdb-&amp;gt;posts WHERE post_date BETWEEN &#039;YEAR-MM-DD (start)&#039; AND &#039;YEAR-MM-DD (end)&#039; ORDER BY comment_count DESC LIMIT 0 , 10&amp;quot;);

foreach ($result as $topten) {
    $postid = $topten-&amp;gt;ID;
    $title = $topten-&amp;gt;post_title;
    $commentcount = $topten-&amp;gt;comment_count;
    if ($commentcount != 0) {
    ?&amp;gt;

&amp;lt;/ul&amp;gt;
</pre>
<p><strong><a href="http://www.wpcode.net/most-commented-posts.html/" target="_blank">Source</a></strong></p>
<h3>How to Display Tags as Dropdown</h3>
<p>Add the below code to your function.php you will turn your standard tag cloud as a cool dropdown menu.</p>
<pre class="brush: php">
 8, &#039;largest&#039; =&amp;gt; 22, &#039;unit&#039; =&amp;gt; &#039;pt&#039;, &#039;number&#039; =&amp;gt; 45,
		&#039;format&#039; =&amp;gt; &#039;flat&#039;, &#039;orderby&#039; =&amp;gt; &#039;name&#039;, &#039;order&#039; =&amp;gt; &#039;ASC&#039;,
		&#039;exclude&#039; =&amp;gt; &#039;&#039;, &#039;include&#039; =&amp;gt; &#039;&#039;
	);
	$args = wp_parse_args( $args, $defaults );

	$tags = get_tags( array_merge($args, array(&#039;orderby&#039; =&amp;gt; &#039;count&#039;, &#039;order&#039; =&amp;gt; &#039;DESC&#039;)) ); // Always query top tags

	if ( empty($tags) )
		return;

	$return = dropdown_generate_tag_cloud( $tags, $args ); // Here&#039;s where those top tags get sorted according to $args
	if ( is_wp_error( $return ) )
		return false;
	else
		echo apply_filters( &#039;dropdown_tag_cloud&#039;, $return, $args );
}

function dropdown_generate_tag_cloud( $tags, $args = &#039;&#039; ) {
	global $wp_rewrite;
	$defaults = array(
		&#039;smallest&#039; =&amp;gt; 8, &#039;largest&#039; =&amp;gt; 22, &#039;unit&#039; =&amp;gt; &#039;pt&#039;, &#039;number&#039; =&amp;gt; 45,
		&#039;format&#039; =&amp;gt; &#039;flat&#039;, &#039;orderby&#039; =&amp;gt; &#039;name&#039;, &#039;order&#039; =&amp;gt; &#039;ASC&#039;
	);
	$args = wp_parse_args( $args, $defaults );
	extract($args);

	if ( !$tags )
		return;
	$counts = $tag_links = array();
	foreach ( (array) $tags as $tag ) {
		$counts[$tag-&amp;gt;name] = $tag-&amp;gt;count;
		$tag_links[$tag-&amp;gt;name] = get_tag_link( $tag-&amp;gt;term_id );
		if ( is_wp_error( $tag_links[$tag-&amp;gt;name] ) )
			return $tag_links[$tag-&amp;gt;name];
		$tag_ids[$tag-&amp;gt;name] = $tag-&amp;gt;term_id;
	}

	$min_count = min($counts);
	$spread = max($counts) - $min_count;
	if ( $spread &amp;lt;= 0 )
		$spread = 1;
	$font_spread = $largest - $smallest;
	if ( $font_spread &amp;lt;= 0 ) 		$font_spread = 1; 	$font_step = $font_spread / $spread; 	// SQL cannot save you; this is a second (potentially different) sort on a subset of data. 	if ( &#039;name&#039; == $orderby ) 		uksort($counts, &#039;strnatcasecmp&#039;); 	else 		asort($counts); 	if ( &#039;DESC&#039; == $order ) 		$counts = array_reverse( $counts, true ); 	$a = array(); 	$rel = ( is_object($wp_rewrite) &amp;amp;&amp;amp; $wp_rewrite-&amp;gt;using_permalinks() ) ? &#039; rel=&amp;quot;tag&amp;quot;&#039; : &#039;&#039;;

	foreach ( $counts as $tag =&amp;gt; $count ) {
		$tag_id = $tag_ids[$tag];
		$tag_link = clean_url($tag_links[$tag]);
		$tag = str_replace(&#039; &#039;, &#039;&amp;amp;nbsp;&#039;, wp_specialchars( $tag ));
		$a[] = &amp;quot;\t$tag ($count)&amp;quot;;
	}

	switch ( $format ) :
	case &#039;array&#039; :
		$return =&amp;amp; $a;
		break;
	case &#039;list&#039; :
		$return = &amp;quot;
&amp;lt;ul class=&amp;quot;wp-tag-cloud&amp;quot;&amp;gt;\n\t
	&amp;lt;li&amp;gt;&amp;quot;;
		$return .= join(&amp;quot;&amp;lt;/li&amp;gt;
\n\t
	&amp;lt;li&amp;gt;&amp;quot;, $a);
		$return .= &amp;quot;&amp;lt;/li&amp;gt;
\n&amp;lt;/ul&amp;gt;
\n&amp;quot;;
		break;
	default :
		$return = join(&amp;quot;\n&amp;quot;, $a);
		break;
	endswitch;

	return apply_filters( &#039;dropdown_generate_tag_cloud&#039;, $return, $tags, $args );
}
?&amp;gt;
</pre>
<p><a href="http://www.wpcode.net/tag-cloud-dropdown.html/" target="_blank"><strong>Source</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2011/08/03/wordpress-code-snippets-and-detailed-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

