<?xml version="1.0" encoding="UTF-8"?><feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en-US"
  xml:base="http://derekdevries.com/wp-atom.php"
   >
	<title type="text">Derek DeVries</title>
	<subtitle type="text"></subtitle>

	<updated>2014-11-19T01:07:49Z</updated>

	<link rel="alternate" type="text/html" href="http://derekdevries.com" />
	<id>http://derekdevries.com/feed/atom/</id>
	<link rel="self" type="application/atom+xml" href="http://derekdevries.com/feed/atom/" />

	<generator uri="https://wordpress.org/" version="4.8.1">WordPress</generator>
	<entry>
		<author>
			<name>derek</name>
						<uri>http://derekdevries.com</uri>
					</author>
		<title type="html"><![CDATA[New Stylesheet Gem]]></title>
		<link rel="alternate" type="text/html" href="http://derekdevries.com/2013/04/29/new-stylesheet-gem/" />
		<id>http://derekdevries.com/?p=173</id>
		<updated>2014-11-19T01:06:38Z</updated>
		<published>2013-04-29T23:52:42Z</published>
		<category scheme="http://derekdevries.com" term="Uncategorized" />		<summary type="html"><![CDATA[I've released the <a href="http://github.com/devrieda/stylesheet">Stylesheet</a> gem for parsing css stylesheets from a website. It is a Ruby implementation of <a href="http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html">DOM Style Sheets</a> objects. 
]]></summary>
		<content type="html" xml:base="http://derekdevries.com/2013/04/29/new-stylesheet-gem/"><![CDATA[<p>I&#8217;ve released the <a href="http://github.com/devrieda/stylesheet">Stylesheet</a> gem for parsing css stylesheets from a website. It is a Ruby implementation of <a href="http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html">DOM Style Sheets</a> objects. </p>
<p>You can find all the stylesheets in a document:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">page = <span style="color:#6666ff; font-weight:bold;">Stylesheet::Document</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;http://sportspyder.com&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
page.<span style="color:#9900CC;">style_sheets</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#008000; font-style:italic;">#&lt;Stylesheet::CssStyleSheet:0x007ff99da462a0&gt;, </span>
<span style="color:#008000; font-style:italic;">#&lt;Stylesheet::CssStyleSheet:0x007ff99da44ae0 &gt;, </span>
<span style="color:#008000; font-style:italic;">#&lt;Stylesheet::CssStyleSheet:0x007ff99da44018&gt;]</span>
&nbsp;
stylesheet = page.<span style="color:#9900CC;">style_sheets</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
stylesheet.<span style="color:#9900CC;">media</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;screen&quot;</span>
&nbsp;
stylesheet.<span style="color:#9900CC;">href</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;http://sportspyder.com/assets/application-26ff2c8d54ab9cd8e74af60fc650390e.css&quot;</span></pre></div></div>

<p>You can find the rules, and selectors on a stylesheet:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">rule = stylesheet.<span style="color:#9900CC;">css_rules</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#008000; font-style:italic;">#&lt;Stylesheet::CssStyleRule css_text:#user_box .post_body .left{width:53px}&gt;</span>
&nbsp;
rule.<span style="color:#9900CC;">selector_text</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;#user_box .post_body .left&quot;</span>
&nbsp;
rule.<span style="color:#9900CC;">css_text</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;#user_box .post_body .left{width:53px}&quot;</span>
&nbsp;
rule.<span style="color:#9900CC;">style</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;width:53px&quot;</span>
&nbsp;
rule.<span style="color:#9900CC;">style</span>.<span style="color:#9900CC;">width</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;53px&quot;</span></pre></div></div>

<p>To install:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">gem install stylesheet</pre></div></div>

<p>Or add to bundler:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">gem <span style="color:#996600;">&quot;stylesheet&quot;</span>, <span style="color:#996600;">&quot;~&gt; 0.1.0&quot;</span></pre></div></div>

]]></content>
		</entry>
		<entry>
		<author>
			<name>derek</name>
						<uri>http://derekdevries.com</uri>
					</author>
		<title type="html"><![CDATA[New SportSpyder Homepage]]></title>
		<link rel="alternate" type="text/html" href="http://derekdevries.com/2013/04/18/new-sportspyder-homepag/" />
		<id>http://derekdevries.com/?p=164</id>
		<updated>2014-11-19T01:06:42Z</updated>
		<published>2013-04-18T20:21:27Z</published>
		<category scheme="http://derekdevries.com" term="Uncategorized" />		<summary type="html"><![CDATA[We&#8217;ve been planning of a redesign for the SportSpyder homepage for a while now. We have a lot of data about that news available on SportSpyder, and we really want to showcase some of the popular articles on SportSpyder for the day. I&#8217;ve done a write-up on the new changes on the SportSpyder Blog.]]></summary>
		<content type="html" xml:base="http://derekdevries.com/2013/04/18/new-sportspyder-homepag/"><![CDATA[<p>We&#8217;ve been planning of a redesign for the <a href="http://sportspyder.com">SportSpyder</a> homepage for a while now. We have a lot of data about that news available on SportSpyder, and we really want to showcase some of the popular articles on SportSpyder for the day. </p>
<p>I&#8217;ve done a write-up on the new changes on the <a href="http://about.sportspyder.com/2013/04/new-homepage/">SportSpyder Blog</a>.</p>
]]></content>
		</entry>
		<entry>
		<author>
			<name>derek</name>
						<uri>http://derekdevries.com</uri>
					</author>
		<title type="html"><![CDATA[Color Parser Demo]]></title>
		<link rel="alternate" type="text/html" href="http://derekdevries.com/2013/02/06/color-parser-demo/" />
		<id>http://derekdevries.com/?p=147</id>
		<updated>2014-11-19T01:06:46Z</updated>
		<published>2013-02-06T15:12:38Z</published>
		<category scheme="http://derekdevries.com" term="Uncategorized" />		<summary type="html"><![CDATA[I've created a small <a href="http://github.com/devrieda/color_parser_demo">Demo App</a> with Sinatra to show how the <a href="http://github.com/devrieda/color_parser">Color Parser</a> Ruby gem works. ]]></summary>
		<content type="html" xml:base="http://derekdevries.com/2013/02/06/color-parser-demo/"><![CDATA[<p>I&#8217;ve created a small <a href="http://github.com/devrieda/color_parser_demo">Demo App</a> with Sinatra to show how the <a href="http://github.com/devrieda/color_parser">Color Parser</a> Ruby gem works. </p>
<p><img src="http://derekdevries.com/wp-content/uploads/2013/02/color-parser-demo.jpg" alt="" title="color-parser-demo"  class="aligncenter size-full full w_border wp-image-150" /></p>
<p>To try it out, <a href="https://github.com/devrieda/color_parser_demo/archive/master.zip">download it from GitHub</a>, install the gem dependencies, and start it up.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">bundle install
ruby app.<span style="color:#9900CC;">rb</span></pre></div></div>

]]></content>
		</entry>
		<entry>
		<author>
			<name>derek</name>
						<uri>http://derekdevries.com</uri>
					</author>
		<title type="html"><![CDATA[Init Visual]]></title>
		<link rel="alternate" type="text/html" href="http://derekdevries.com/2013/02/01/init-visual/" />
		<id>http://derekdevries.com/?p=158</id>
		<updated>2014-11-19T01:06:49Z</updated>
		<published>2013-02-01T18:26:17Z</published>
		<category scheme="http://derekdevries.com" term="Uncategorized" />		<summary type="html"><![CDATA[I&#8217;ve created a new site for my Freelance Design &#38; Development services at Init Visual. I&#8217;m available to make your next web development project a success. Contact Me for project inquiries.]]></summary>
		<content type="html" xml:base="http://derekdevries.com/2013/02/01/init-visual/"><![CDATA[<p>I&#8217;ve created a new site for my Freelance Design &amp; Development services at <a href="http://initvisual.com/">Init Visual</a>. I&#8217;m available to make your next web development project a success. <a href="http://initvisual.com/contacts/new">Contact Me</a> for project inquiries. </p>
<p><a href="http://initvisual.com"><img src="http://derekdevries.com/wp-content/uploads/2013/02/Screen-Shot-2013-05-03-at-12.20.20-PM1.png" alt="" title="Screen Shot 2013-05-03 at 12.20.20 PM" width="169" height="102" class="aligncenter size-full w_border wp-image-162" /></a></p>
]]></content>
		</entry>
		<entry>
		<author>
			<name>derek</name>
						<uri>http://derekdevries.com</uri>
					</author>
		<title type="html"><![CDATA[Pure CSS3 Buttons]]></title>
		<link rel="alternate" type="text/html" href="http://derekdevries.com/2013/01/18/pure-css3-buttons/" />
		<id>http://derekdevries.com/?p=140</id>
		<updated>2014-11-19T01:06:55Z</updated>
		<published>2013-01-18T21:17:20Z</published>
		<category scheme="http://derekdevries.com" term="Uncategorized" />		<summary type="html"><![CDATA[Years ago I combined various techniques to create custom buttons that worked cross-browser and were compatible with IE6+. With IE6-8 usage waning, I&#8217;ve added a new project on GitHub that recreates these same buttons using CSS3 instead of images. The CSS Buttons project uses pure CSS to replicate the buttons from the Custom Buttons project, [&#8230;]]]></summary>
		<content type="html" xml:base="http://derekdevries.com/2013/01/18/pure-css3-buttons/"><![CDATA[<p>Years ago I combined various techniques to create <a href="https://github.com/devrieda/custom_buttons">custom buttons</a> that worked cross-browser and were compatible with IE6+. With IE6-8 usage waning, I&#8217;ve added a new project on GitHub that recreates these same buttons using  CSS3 instead of images. </p>
<p>The <a href="https://github.com/devrieda/css_buttons">CSS Buttons</a> project uses pure CSS to replicate the buttons from the Custom Buttons project, and is tested in IE9+, Safari, Firefox, and Chrome.</p>
<p>The markup is similar to the custom_buttons project, </p>
<p>The markup for styling a <code>&lt;button&gt;</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button primary&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button disabled&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>And the markup for styling an <code>&lt;a&gt;</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button primary&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button disabled&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The result from the examples:<br />
<img src="http://derekdevries.com/wp-content/uploads/2013/04/buttons.png" alt="" title="buttons" width="252" height="44" class="alignnone size-full wp-image-135" /></p>
<p>Get the code on <a href="https://github.com/devrieda/css_buttons">GitHub</a>.</p>
]]></content>
		</entry>
		<entry>
		<author>
			<name>derek</name>
						<uri>http://derekdevries.com</uri>
					</author>
		<title type="html"><![CDATA[Tweet Timestamps]]></title>
		<link rel="alternate" type="text/html" href="http://derekdevries.com/2013/01/10/tweet-timestamps/" />
		<id>http://derekdevries.com/?p=123</id>
		<updated>2014-11-19T01:06:59Z</updated>
		<published>2013-01-10T20:15:15Z</published>
		<category scheme="http://derekdevries.com" term="Uncategorized" />		<summary type="html"><![CDATA[Back in August, Twitter released their &#8220;Rules of the Road&#8221; dictating some new Twitter display requirements. One of these requirements is the timestamp format for tweets: Tweet timestamp should be displayed in the top right corner. For Tweets that have been sent in the last 24 hours, use the short form timestamp relative to the [&#8230;]]]></summary>
		<content type="html" xml:base="http://derekdevries.com/2013/01/10/tweet-timestamps/"><![CDATA[<p>Back in August, Twitter released their &#8220;Rules of the Road&#8221; dictating some new <a href="https://dev.twitter.com/terms/display-requirements">Twitter display requirements</a>. One of these requirements is the timestamp format for tweets: </p>
<blockquote><p>Tweet timestamp should be displayed in the top right corner.<br />
For Tweets that have been sent in the last 24 hours, use the short form timestamp relative to the current time, for example “20s” for a Tweet sent 20 seconds ago, “3m” for 3 minutes ago, “5h” for 5 hours ago.<br />
Tweets older than 24 hours should show a short form date including the day and month, e.g., “6 Jun”.</p></blockquote>
<p>I&#8217;ve created the <a href="https://github.com/devrieda/tweet_date_format">Tweet Date Format</a> project on GitHub which currently has an Objective-C NSDate category for formatting to the tweet timestamp, and a Rails helper for doing this as well. </p>
]]></content>
		</entry>
		<entry>
		<author>
			<name>derek</name>
						<uri>http://derekdevries.com</uri>
					</author>
		<title type="html"><![CDATA[Color Parser Gem]]></title>
		<link rel="alternate" type="text/html" href="http://derekdevries.com/2013/01/09/color-parser-gem/" />
		<id>http://derekdevries.com/?p=145</id>
		<updated>2014-11-19T01:07:03Z</updated>
		<published>2013-01-09T22:23:39Z</published>
		<category scheme="http://derekdevries.com" term="Uncategorized" />		<summary type="html"><![CDATA[On SportSpyder we display a small icon for every source we use. To keep things fresh we sample and use colors from that source&#8217;s website when we can. It was a tedious process to build images for each source, but fortunately we wizened to using CSS for this. However, we still needed a faster way [&#8230;]]]></summary>
		<content type="html" xml:base="http://derekdevries.com/2013/01/09/color-parser-gem/"><![CDATA[<p>On <a href="http://sportspyder.com">SportSpyder</a> we display a small icon for every source we use. To keep things fresh we sample and use colors from that source&#8217;s website when we can. It was a tedious process to build images for each source, but fortunately we wizened to using CSS for this. However, we still needed a faster way to sample colors from a website. </p>
<p>Enter to the <a href="http://github.com/devrieda/color_parser">Color Parser</a> Ruby Gem. This gem lets you pass in a website&#8217;s URL, and the script will parse out the stylesheets to find the colors used in the page: </p>
<p>For example, to get the colors on google.com:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">page = <span style="color:#6666ff; font-weight:bold;">ColorParser::Page</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;http://google.com/&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
page.<span style="color:#9900CC;">colors</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;ffffff&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">5</span>, <span style="color:#996600;">&quot;c9d7f1&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">1</span>, <span style="color:#996600;">&quot;0000cc&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">2</span>, <span style="color:#996600;">&quot;dd8e27&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">1</span>, <span style="color:#996600;">&quot;990000&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">1</span>, 
    <span style="color:#996600;">&quot;3366cc&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">3</span>, <span style="color:#996600;">&quot;000000&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">2</span>, <span style="color:#996600;">&quot;1111cc&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">5</span>, <span style="color:#996600;">&quot;cccccc&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">2</span>, <span style="color:#996600;">&quot;551a8b&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>This gives us the number of occurrences of each color in the styles. </p>
<p>To install:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">gem install color_parser</pre></div></div>

<p>Or add to bundler:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">gem <span style="color:#996600;">&quot;color_parser&quot;</span>, <span style="color:#996600;">&quot;~&gt; 0.0.2&quot;</span></pre></div></div>

]]></content>
		</entry>
		<entry>
		<author>
			<name>derek</name>
						<uri>http://derekdevries.com</uri>
					</author>
		<title type="html"><![CDATA[Rails Seed Data]]></title>
		<link rel="alternate" type="text/html" href="http://derekdevries.com/2009/04/13/rails-seed-data/" />
		<id>http://derekdevries.com/?p=72</id>
		<updated>2014-11-19T01:07:16Z</updated>
		<published>2009-04-13T05:58:03Z</published>
		<category scheme="http://derekdevries.com" term="Uncategorized" />		<summary type="html"><![CDATA[Seed data in Rails applications has been <a href="http://railspikes.com/2008/2/1/loading-seed-data">discussed</a> <a href="http://quotedprintable.com/2007/11/16/seed-data-in-rails">ad</a> <a href="http://stackoverflow.com/questions/62201/how-and-whether-to-populate-rails-application-with-initial-data">nauseum</a>, but I wanted to throw out another simple option that I use quite regularly. I've essentially found that seed data for my applications comes in three different flavors. ]]></summary>
		<content type="html" xml:base="http://derekdevries.com/2009/04/13/rails-seed-data/"><![CDATA[<p>Seed data in Rails applications has been <a href="http://railspikes.com/2008/2/1/loading-seed-data">discussed</a> <a href="http://quotedprintable.com/2007/11/16/seed-data-in-rails">ad</a> <a href="http://stackoverflow.com/questions/62201/how-and-whether-to-populate-rails-application-with-initial-data">nauseum</a>, but I wanted to throw out another simple option that I use quite regularly. I&#8217;ve essentially found that seed data for my applications comes in three different flavors. </p>
<h3>1. Always seed</h3>
<p>We wipe out and reload this seed data multiple times in a application&#8217;s lifetime. A good example of this in <a href="http://sportspyder.com">SportSpyder</a> is the list of sports such as MLB, NFL, etc. This data is never modified by the application itself, and is essentially read-only. If we want to add a new sport, we can wipe out and reload the seed data for the table without repercussions. </p>
<h3>2. Seed once</h3>
<p>We seed this data to the table only once. A good example of this is inserting an application&#8217;s first Admin user. After seeding the initial data, the application takes over modification and maintenance of the data in that table. You would never want to reseed the table at a later time since this would wipe out additional data added by other means.</p>
<h3>3. Development/Dummy data</h3>
<p>This is dummy data that we throw into an application to check out how things look before we go live with real content in the application. </p>
<h3>Loading the data</h3>
<p>Lately I&#8217;ve tossed aside test fixtures in favor of using <a href="http://www.thoughtbot.com/projects/factory_girl">FactoryGirl</a> for testing, but I find yaml files work fine for most seed data (as long as there isn&#8217;t too much of it.) You could probably incorporate this idea into object based seeding options as well. </p>
<p>To handle the three different types of seed data, we create a few subdirectories within <code>db/</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> db<span style="color: #000000; font-weight: bold;">/</span>seed<span style="color: #000000; font-weight: bold;">/</span>always
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> db<span style="color: #000000; font-weight: bold;">/</span>seed<span style="color: #000000; font-weight: bold;">/</span>develop
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> db<span style="color: #000000; font-weight: bold;">/</span>seed<span style="color: #000000; font-weight: bold;">/</span>once</pre></div></div>

<p>In here we put YML based fixture files with the data we want to load. One thing to remember is that you probably want to manually specify the <code>id</code>s instead of relying on foxy fixtures. You don&#8217;t want your <code>id</code> column starting at numbers like <code>237252458</code>. </p>
<p>We then add a new file named <code>lib/tasks/db.rake</code> with the following tasks:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'active_record/fixtures'</span>
&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:db</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  desc <span style="color:#996600;">&quot;Seed the database with once/ and always/ fixtures.&quot;</span>
  task <span style="color:#ff3333; font-weight:bold;">:seed</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:environment</span> <span style="color:#9966CC; font-weight:bold;">do</span> 
    load_fixtures <span style="color:#996600;">&quot;seed/once&quot;</span>
    load_fixtures <span style="color:#996600;">&quot;seed/always&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:always</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  desc <span style="color:#996600;">&quot;Seed the database with develop/ fixtures.&quot;</span>
  task <span style="color:#ff3333; font-weight:bold;">:develop</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:environment</span> <span style="color:#9966CC; font-weight:bold;">do</span> 
    load_fixtures <span style="color:#996600;">'seed/develop'</span>, <span style="color:#ff3333; font-weight:bold;">:always</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
  private
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> load_fixtures<span style="color:#006600; font-weight:bold;">&#40;</span>dir, always = <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>RAILS_ROOT, <span style="color:#996600;">'db'</span>, dir, <span style="color:#996600;">'*.yml'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>fixture_file<span style="color:#006600; font-weight:bold;">|</span>
      table_name = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">basename</span><span style="color:#006600; font-weight:bold;">&#40;</span>fixture_file, <span style="color:#996600;">'.yml'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">if</span> table_empty?<span style="color:#006600; font-weight:bold;">&#40;</span>table_name<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">||</span> always
        truncate_table<span style="color:#006600; font-weight:bold;">&#40;</span>table_name<span style="color:#006600; font-weight:bold;">&#41;</span>
        Fixtures.<span style="color:#9900CC;">create_fixtures</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'db/'</span>, dir<span style="color:#006600; font-weight:bold;">&#41;</span>, table_name<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>  
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> table_empty?<span style="color:#006600; font-weight:bold;">&#40;</span>table_name<span style="color:#006600; font-weight:bold;">&#41;</span>
    quoted = connection.<span style="color:#9900CC;">quote_table_name</span><span style="color:#006600; font-weight:bold;">&#40;</span>table_name<span style="color:#006600; font-weight:bold;">&#41;</span>
    connection.<span style="color:#9900CC;">select_value</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;SELECT COUNT(*) FROM #{quoted}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_i</span>.<span style="color:#9900CC;">zero</span>?
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> truncate_table<span style="color:#006600; font-weight:bold;">&#40;</span>table_name<span style="color:#006600; font-weight:bold;">&#41;</span>
    quoted = connection.<span style="color:#9900CC;">quote_table_name</span><span style="color:#006600; font-weight:bold;">&#40;</span>table_name<span style="color:#006600; font-weight:bold;">&#41;</span>
    connection.<span style="color:#9900CC;">execute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;DELETE FROM #{quoted}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> connection
    <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">connection</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>And that&#8217;s it. You can now seed your data by running:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rake db:seed</pre></div></div>

<p>And insert development/dummy data with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rake db:develop</pre></div></div>

]]></content>
			<link rel="replies" type="text/html" href="http://derekdevries.com/2009/04/13/rails-seed-data/#comments" thr:count="8"/>
		<link rel="replies" type="application/atom+xml" href="http://derekdevries.com/2009/04/13/rails-seed-data/feed/atom/" thr:count="8"/>
		<thr:total>8</thr:total>
		</entry>
		<entry>
		<author>
			<name>derek</name>
						<uri>http://derekdevries.com</uri>
					</author>
		<title type="html"><![CDATA[Custom Buttons with CSS]]></title>
		<link rel="alternate" type="text/html" href="http://derekdevries.com/2009/04/02/custom-buttons-with-css/" />
		<id>http://derekdevries.com/?p=44</id>
		<updated>2014-11-19T01:07:20Z</updated>
		<published>2009-04-02T06:51:38Z</published>
		<category scheme="http://derekdevries.com" term="Uncategorized" />		<summary type="html"><![CDATA[While localizing our <a href="http://maintainabletest.com/">Automated Test Database</a> software, we found the need for a better solution for styling buttons. This post covers using CSS to style buttons using  both the &#60;button&#62; and &#60;a&#62; tags across all major browsers.

]]></summary>
		<content type="html" xml:base="http://derekdevries.com/2009/04/02/custom-buttons-with-css/"><![CDATA[<p><strong>Update:</strong> I have added another project <a href="https://github.com/devrieda/css_buttons">on GitHub</a> for styling buttons using CSS that supports IE9+. It is preferred to this method if you don&#8217;t need support for older versions of ie. </p>
<p>While localizing software, I found the need for a better solution for styling buttons. My requirements were: </p>
<ol>
<li>Consistent CSS based buttons for both <code>&lt;button&gt;</code> and <code>&lt;a&gt;</code> elements.</li>
<li>Active, hover, primary, and disabled button states.</li>
<li>Compatible and consistently in IE6, IE7, IE8, Firefox, Safari, and Chrome.</li>
<li>Semantic markup.</li>
</ol>
<p>I found a few blog posts that cover some (or most) of these requirements, but none of them seem to cover them all. Most concentrate on either the button or anchor tag, but not both. </p>
<p>I&#8217;ve created a GitHub project &#8212; <a href="http://github.com/devrieda/custom_buttons/tree/master">custom_buttons</a> that contains XHTML, CSS, and images for buttons to do it all. There are two different examples &#8212; a round button, and a more rectangular button. The code takes advantage of the <a href="http://alistapart.com/articles/slidingdoors/">sliding doors technique</a> so that the button expands to fit the size of the text. </p>
<p>The markup for styling a <code>&lt;button&gt;</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button primary&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button disabled&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>And the markup for styling an <code>&lt;a&gt;</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button primary&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button large_button disabled&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Submit<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The result from both examples:<br />
<img src="http://derekdevries.com/wp-content/uploads/2013/04/buttons.png" alt="" title="buttons" width="252" height="44" class="alignnone size-full wp-image-135" /></p>
<p>In my examples I use the &#8220;large_button&#8221; and &#8220;rect_button&#8221; classes to differentiate between multiple button styles that use the same technique. If you only require a single button style, you can probably get away with simplifying the code to just use <code>class="button"</code>.</p>
<p>A lot of this code is based on content in the following articles (and their helpful comments):</p>
<p><a href="http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html">How to make sexy buttons with CSS</a><br />
<a href="http://stopdesign.com/archive/2009/02/04/recreating-the-button.html">Recreating the button</a><br />
<a href="http://particletree.com/features/rediscovering-the-button-element/">Rediscovering the button element</a><br />
<a href="http://www.filamentgroup.com/lab/styling_the_button_element_with_sliding_doors/">Styling the button element with sliding doors</a></p>
]]></content>
			<link rel="replies" type="text/html" href="http://derekdevries.com/2009/04/02/custom-buttons-with-css/#comments" thr:count="15"/>
		<link rel="replies" type="application/atom+xml" href="http://derekdevries.com/2009/04/02/custom-buttons-with-css/feed/atom/" thr:count="15"/>
		<thr:total>15</thr:total>
		</entry>
		<entry>
		<author>
			<name>derek</name>
						<uri>http://derekdevries.com</uri>
					</author>
		<title type="html"><![CDATA[Auditing UX with Documentation]]></title>
		<link rel="alternate" type="text/html" href="http://derekdevries.com/2008/05/07/auditing-user-experience-with-documentation/" />
		<id>http://derekdevries.com/?p=17</id>
		<updated>2014-11-19T01:07:49Z</updated>
		<published>2008-05-08T00:16:10Z</published>
		<category scheme="http://derekdevries.com" term="Uncategorized" /><category scheme="http://derekdevries.com" term="ux" />		<summary type="html"><![CDATA[End-user documentation has always been a thorn for many developers. We'd much rather be writing working software than explaining how that software works. It is especially difficult working in an agile environment where things change so quickly that writing extensive end-user documentation just slows down application development. ]]></summary>
		<content type="html" xml:base="http://derekdevries.com/2008/05/07/auditing-user-experience-with-documentation/"><![CDATA[<p>End-user documentation has always been a thorn for many developers. We&#8217;d much rather be writing working software than explaining how that software works. It is especially difficult working in an agile environment where things change so quickly that writing extensive end-user documentation just slows down application development. </p>
<p>One real benefit of end-user documentation is that it generally will help make your application better. When you&#8217;re explaining in depth how to use your application, it becomes immediately obvious where you&#8217;re application is deficient, confusing, or inconsistent. </p>
<p>Try writing a walk-through of your application. Write down what each element of your application does, and why. If you find areas that are confusing to write down, chances are you&#8217;ll be getting an e-mail from a client who is confused as well. </p>
]]></content>
		</entry>
	</feed>
