<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:www.refactormycode.com,2007:users1339</id>
  <link type="application/atom+xml" href="http://www.refactormycode.com/users/1339" rel="self"/>
  <title>bedlam.myopenid.com</title>
  <updated>Fri Feb 13 00:13:48 -0800 2009</updated>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor146963</id>
    <published>2009-02-13T00:13:48-08:00</published>
    <title>[JavaScript] On Tab-Switching in jQuery</title>
    <content type="html">&lt;p&gt;If this idea is that only one 'item' should be visible at any given time, this should work with any number of links and items so long as the initial states are set. &lt;/p&gt;

&lt;pre&gt;## html [html]
&amp;lt;ul id=&amp;quot;nav&amp;quot;&amp;gt;
	&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#one&amp;quot;&amp;gt;Example&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#two&amp;quot;&amp;gt;Another&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#three&amp;quot;&amp;gt;Yet another&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&amp;lt;div id=&amp;quot;items&amp;quot;&amp;gt;
	&amp;lt;div class=&amp;quot;first item&amp;quot; id=&amp;quot;one&amp;quot;&amp;gt;
		This is the first item. By default it's shown.
	&amp;lt;/div&amp;gt;
	&amp;lt;div class=&amp;quot;item&amp;quot; id=&amp;quot;two&amp;quot;&amp;gt;
		This is item two. By default it's hidden.
	&amp;lt;/div&amp;gt;
	&amp;lt;div class=&amp;quot;last item&amp;quot;	id=&amp;quot;three&amp;quot;&amp;gt;
		This is item three. By default it's hidden.
	&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

## css [css]
#items div {
	display: none;
}

#items #one {
	display: block;
}

## js [jquery_javascript]
$(document).ready(function() {
	$('#nav a').click(function(){
		var target = $(this).attr('href');
		$('#items div').hide().each(function(){
			targetSelector = '#' + $(this).attr('id');
			if(targetSelector == target) {
				$(targetSelector).show();
			}
		});
	});
});&lt;/pre&gt;</content>
    <author>
      <name>bedlam.myopenid.com</name>
      <email>bedlamhotel@gmail.com</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/608-tab-switching-in-jquery/refactors/146963" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Code753</id>
    <published>2009-02-11T00:43:52-08:00</published>
    <updated>2009-06-14T15:30:01-07:00</updated>
    <title>[Bash] Unzip large database dump directly into mysql</title>
    <content type="html">&lt;p&gt;Just wondering if this is the best way to do this when, for example, you need to restore a database dump on a server, but the unzipped file is too large for the disk quota...&lt;/p&gt;

&lt;pre&gt;gunzip -c database_dump.sql.gz | mysql -u username -h host -ppassword database&lt;/pre&gt;</content>
    <author>
      <name>bedlam.myopenid.com</name>
      <email>bedlamhotel@gmail.com</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/753-unzip-large-database-dump-directly-into-mysql" rel="alternate"/>
  </entry>
</feed>

