<?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>piddmedia &#187; Tutorials</title>
	<atom:link href="http://piddmedia.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://piddmedia.com</link>
	<description>interactive design and development</description>
	<lastBuildDate>Mon, 28 Nov 2011 19:42:03 +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>New Rails 3 app, routes.rb is good, database.yml is good. Still get 500 error.</title>
		<link>http://piddmedia.com/tutorials/new-rails-3-app-routes-rb-is-good-database-yml-is-good-still-get-500-error/</link>
		<comments>http://piddmedia.com/tutorials/new-rails-3-app-routes-rb-is-good-database-yml-is-good-still-get-500-error/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 19:38:58 +0000</pubDate>
		<dc:creator>C. Scott Asbach</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Rails 3]]></category>

		<guid isPermaLink="false">http://piddmedia.com/?p=1385</guid>
		<description><![CDATA[I have found there are A LOT of things that can go wrong with a Rails deployment, even if your 'Developer Friendly RoR Host' offers 'Fast Rails Deployment' and 'Incredible Ruby Hosting' and you are merely trying to deploy a simple 'Hello World' app. <a href="http://piddmedia.com/tutorials/new-rails-3-app-routes-rb-is-good-database-yml-is-good-still-get-500-error/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have found there are A LOT of things that can go wrong with a Rails deployment, even if your &#8216;Developer Friendly RoR Host&#8217; offers &#8216;Fast Rails Deployment&#8217; and &#8216;Incredible Ruby Hosting&#8217; and you are merely trying to deploy a simple &#8216;Hello World&#8217; app.<span id="more-1385"></span></p>
<p>As a result the internet is full of different suggestions for tweaks to make in various configuration files all throughout your Rails application directory tree. There are far too many of them to list here. I am going to provide the solution that worked for me because it was not nearly as common as the other suggested solutions so I think it needs little more representation.</p>
<p>If your database.yml is configured correctly (this is YAML, even bad white space can be a culprit here), and your routes.rb is configured correctly (if you are using rails generate commands this shouldn&#8217;t be an issue), and your are not trying to run your app from a sub directory (there can be quite a few tricky configuration hiccups associated with this), and you are running Rails v >= 3 (so much of the advice and tutorials floating around out there are for older versions, be careful!); like me. Then you might want to check <code>/log/production.log</code> and see if there&#8217;s an error like this: <code>Template::Error (application.css isn't precompiled):</code>. If there is then you need to run the following command in the command line from your applications root:</p>
<pre class="brush: plain; title: ; notranslate">
rake assets:precompile
</pre>
<p><strongOR</strong> you can open up <code>/config/environments/production.rb</code> and set <code>config.assets.compile</code> to <code>true</code>. This method is not recommended for use in production environments.</p>
]]></content:encoded>
			<wfw:commentRss>http://piddmedia.com/tutorials/new-rails-3-app-routes-rb-is-good-database-yml-is-good-still-get-500-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Substitute Click for Hover on Touch Devices</title>
		<link>http://piddmedia.com/tutorials/substitute-click-for-hover-on-touch-devices/</link>
		<comments>http://piddmedia.com/tutorials/substitute-click-for-hover-on-touch-devices/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 20:45:19 +0000</pubDate>
		<dc:creator>C. Scott Asbach</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tooltip]]></category>
		<category><![CDATA[touch interface]]></category>

		<guid isPermaLink="false">http://piddmedia.com/?p=1316</guid>
		<description><![CDATA[In this tutorial I will show you a brief example of just such an alternative. In the example we have an <code>&#60;abbr&#62;</code> with a tooltip. I use the <code>&#60;abbr&#62;</code> tag for two important reasons. First, in modern browsers, <code>&#60;abbr&#62;</code> tags will produce a browser tooltip by default anyway so we will have graceful degradation. Second, we leverage this by putting the text of the tooltip in the <code>&#60;abbr&#62;</code>'s title attribute and this allows us to use jQuery to grab this text and use it for the content of our custom tooltip. <a href="http://piddmedia.com/tutorials/substitute-click-for-hover-on-touch-devices/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<img width="550" height="196" src="http://piddmedia.com/wp-content/uploads/2011/03/touchhover-550x196.png" class="attachment-single-post-thumbnail wp-post-image" alt="touchhover" title="touchhover" /><h3>Fact:</h3>
<p> Hovering doesn&#8217;t work out so well on devices with a touch interface.</p>
<h3>Prediction:</h3>
<p>A substantial portion, if not the majority of web browsing will be done with touch devices.</p>
<h3>Conclusion:</h3>
<p>We need to create alternatives to hover events when we design our user experience.<br />
<span id="more-1316"></span></p>
<h2>A Solution</h2>
<p>In this tutorial I will show you a brief example of just such an alternative. In the example we have an <code>&lt;abbr&gt;</code> with a tooltip. I use the <code>&lt;abbr&gt;</code> tag for two important reasons. First, in modern browsers, <code>&lt;abbr&gt;</code> tags will produce a browser tooltip by default anyway so we will have graceful degradation. Second, we leverage this by putting the text of the tooltip in the <code>&lt;abbr&gt;</code>&#8216;s title attribute and this allows us to use jQuery to grab this text and use it for the content of our custom tooltip.</p>
<h2>The Code:</h2>
<h3>The HTML</h3>
<p>Just a simple document with an abbreviation that has a tooltip.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;tooltip.css&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;p&gt;For a tooltip hover or click &lt;abbr title=&quot;This text will show up in your tooltip!&quot;&gt;here&lt;/abbr&gt;.&lt;/p&gt;
    &lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js'&gt;&lt;/script&gt;
    &lt;script type='text/javascript' src='touchHover.js'&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h3>The CSS</h3>
<p>Styles for the abbreviation and the tooltip.</p>
<pre class="brush: css; title: ; notranslate">
abbr
{
        border-bottom: 1px dotted #666;
        cursor: help;
}

.tooltip
{
	position:absolute;
	background-color:#eeeefe;
	border: 1px solid #aaaaca;
	font-size: smaller;
	padding:4px;
	width: 160px;
	box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
	-moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
	-webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}
</pre>
<h3>The JS</h3>
<p>Here&#8217;s what the example is all about. We get rid of the browsers tooltip and make our own. Then we make a clickable tooltip that fades out after a short delay.</p>
<pre class="brush: jscript; title: ; notranslate">
/**
 * touchHover.js
 *
 * Create tooltips on mouseover or on click (for supporting touch interfaces).
 *
 * @author C. Scott Asbach
 */

$(document).ready(function() {	

	/**
	 * store the value of and then remove the title attributes from the
	 * abbreviations (thus removing the default tooltip functionality of
     * the abbreviations)
	 */
	$('abbr').each(function(){		

		$(this).data('title',$(this).attr('title'));
		$(this).removeAttr('title');

	});

    /**
	 * when abbreviations are mouseover-ed show a tooltip with the data from the title attribute
	 */
	$('abbr').mouseover(function() {		

		// first remove all existing abbreviation tooltips
		$('abbr').next('.tooltip').remove();

		// create the tooltip
		$(this).after('&lt;span class=&quot;tooltip&quot;&gt;' + $(this).data('title') + '&lt;/span&gt;');

		// position the tooltip 4 pixels above and 4 pixels to the left of the abbreviation
		var left = $(this).position().left + $(this).width() + 4;
		var top = $(this).position().top - 4;
		$(this).next().css('left',left);
		$(this).next().css('top',top);				

	});

    /**
	 * when abbreviations are clicked trigger their mouseover event then fade the tooltip
	 * (this is friendly to touch interfaces)
	 */
	$('abbr').click(function(){

		$(this).mouseover();

		// after a slight 2 second fade, fade out the tooltip for 1 second
		$(this).next().animate({opacity: 0.9},{duration: 2000, complete: function(){
			$(this).fadeOut(1000);
		}});

	});

	/**
	 * Remove the tooltip on abbreviation mouseout
	 */
	$('abbr').mouseout(function(){

		$(this).next('.tooltip').remove();				

	});	

});
</pre>
<h2>Happy Clicking!</h2>
<p>There you have it. While this is a basic example, with a little imagination you could apply similar techniques to all of your essential interactions that are currently dependent on hovers.</p>
<h3><em><a href="https://gist.github.com/867744" title="Download this example from gist.github" target="_blank">Got the Gist?</a></em></h3>
<p><a style="display:none" href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=7779576" rel="tag">CodeProject</a></p>
]]></content:encoded>
			<wfw:commentRss>http://piddmedia.com/tutorials/substitute-click-for-hover-on-touch-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ShareThis Social Bookmarking Counters on your WordPress Blog</title>
		<link>http://piddmedia.com/tutorials/sharethis-social-bookmarking-counters-on-your-wordpress-blog/</link>
		<comments>http://piddmedia.com/tutorials/sharethis-social-bookmarking-counters-on-your-wordpress-blog/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 16:05:41 +0000</pubDate>
		<dc:creator>C. Scott Asbach</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[social bookmarking]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://piddmedia.com/?p=891</guid>
		<description><![CDATA[So I was really impressed with the new buttons that <a title="ShareThis" href="http://sharethis.com/" target="_blank">ShareThis</a> is offering now <del>but was disappointed to find out that they don't currently support them for WordPress (If you use their WordPress plug-in you get the <a title="LAME!" href="http://sharethis.com/images/new/Button1.png" target="_blank">old version</a> of the ShareThis button).</del><ins>The new ShareThis WordPress plug-in has been released and you can find it <a title="ShareThis WordPress plug-in" href="http://wordpress.org/extend/plugins/share-this/" target="_blank">here</a>.</ins> But, they did provide some copy &#38; paste code, so I figured where there's a will there's a way (As you can see from the counters below this post there's a happy ending to this story!). <a href="http://piddmedia.com/tutorials/sharethis-social-bookmarking-counters-on-your-wordpress-blog/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<img width="550" height="196" src="http://piddmedia.com/wp-content/uploads/2010/08/buttons-550x196.jpg" class="attachment-single-post-thumbnail wp-post-image" alt="buttons" title="buttons" /><p>So I was really impressed with the new buttons that <a title="ShareThis" href="http://sharethis.com/" target="_blank">ShareThis</a> is offering now <del>but was disappointed to find out that they don&#8217;t currently support them for WordPress (If you use their WordPress plug-in you get the <a title="LAME!" href="http://sharethis.com/images/new/Button1.png" target="_blank">old version</a> of the ShareThis button).</del><ins>The new ShareThis WordPress plug-in has been released and you can find it <a title="ShareThis WordPress plug-in" href="http://wordpress.org/extend/plugins/share-this/" target="_blank">here</a>.</ins> But, they did provide some copy &amp; paste code, so I figured where there&#8217;s a will there&#8217;s a way (As you can see from the counters below this post there&#8217;s a happy ending to this story!).<span id="more-891"></span></p>
<p><strong>NOTE:</strong> This tutorial involves making edits to the functions.php file in your WordPress theme.</p>
<p><span style="font-size: 18px; color: #000000; line-height: 27px;">So here&#8217;s the copy &amp; paste code provided by ShareThis:</span></p>
<p>This code goes in <a title="The Loop" href="http://codex.wordpress.org/The_Loop" target="_blank">the loop</a> with the post:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;span class=&quot;st_twitter_vcount&quot; displayText=&quot;Tweet&quot;&lt;/span&gt;
&lt;span class=&quot;st_facebook_vcount&quot; displayText=&quot;Share&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;st_email_vcount&quot; displayText=&quot;Email&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;st_sharethis_vcount&quot; displayText=&quot;Share&quot;&gt;&lt;/span&gt;
</pre>
<p>This code goes in the footer of your page:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script src=&quot;http://wd.sharethis.com/button/buttons.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
stLight.options({publisher:'YOUR PUBLISHER KEY'})
&lt;/script&gt;
</pre>
<p>This particular code is for the <strong>vertical counters</strong> if you pick a different button type you will get different results. Note however, that if you aren&#8217;t going to use the counters then you may have issues outside of the scope of this tutorial. I&#8217;ve provided the above as an example of what the code looks like when we start out, you should really go to the ShareThis site yourself (sign up if you haven&#8217;t already) and copy and paste the button code from them because it will already have your publisher key embedded in it.</p>
<h2>How to add the URL and title of your post:</h2>
<p>ShareThis provides some <a title="Button Attributes" href="http://help.sharethis.com/customization/chicklet-counts" target="_blank">attributes</a> to control your counters. You need to add the st_url and st_title attributes to each one of the spans in the loop code shown above. If you don&#8217;t add these attributes then by default the counters will share and track the URL and title of the current page.  Which is fine if we are viewing a single post, but on the home page for example, the buttons will be tracking and sharing the home page and not the individual posts with which they are associated.</p>
<h3>How do we fix this?</h3>
<p>You will need to use the <code>get_permalink()</code> and <code>get_the_title()</code> functions to return the URL and title of the current post in the loop. Then insert these values into all of your spans.  This brings us to our first function which we will add to functions.php found in your themes directory.</p>
<p><strong>sharethis_button()</strong></p>
<pre class="brush: php; title: ; notranslate">
function sharethis_button() {
$st_url = 'st_url=&quot;'.get_permalink().'&quot; ';
$st_title = 'st_title=&quot;'.get_the_title().'&quot; ';
	return '
		&lt;p&gt;
		&lt;span  '.$st_url.$st_title.'class=&quot;st_twitter_vcount&quot; displayText=&quot;Tweet&quot;&gt;&lt;/span&gt;
		&lt;span  '.$st_url.$st_title.'class=&quot;st_facebook_vcount&quot; displayText=&quot;Share&quot;&gt;&lt;/span&gt;
		&lt;span  '.$st_url.$st_title.'class=&quot;st_email_vcount&amp;amp&quot; displayText=&quot;Email&quot;&gt;&lt;/span&gt;
		&lt;span  '.$st_url.$st_title.'class=&quot;st_sharethis_vcount&quot; displayText=&quot;Share&quot;&gt;&lt;/span&gt;
		&lt;/p&gt;
		';
}
</pre>
<p>First we write our post&#8217;s URL and title to variables including the rest of the attribute definitions as well. So the value of these variables would be something like: <code> st_url="http://www.piddmedia.com/tutorials/sharethis-social-bookmarking-counters-on-your-wordpress-blog" </code> and <code>st_title="ShareThis Social Bookmarking Counters on your WordPress Blog"</code> Then we return our original spans but with the new attributes inserted into each one. I also wrapped the spans in <code>p</code> tags so the counters don&#8217;t misbehave with the layout. You might add some other styling depending on your needs.</p>
<p><strong>NEXT:</strong>How to insert the counters into your posts:</p>
]]></content:encoded>
			<wfw:commentRss>http://piddmedia.com/tutorials/sharethis-social-bookmarking-counters-on-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

