<?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>Monsterbox Productions</title>
	<atom:link href="http://monsterboxpro.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://monsterboxpro.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 07 May 2012 16:29:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Vote up this on Hacker News!</title>
		<link>http://monsterboxpro.com/blog/2012/05/07/vote-up-this-on-hacker-news/</link>
		<comments>http://monsterboxpro.com/blog/2012/05/07/vote-up-this-on-hacker-news/#comments</comments>
		<pubDate>Mon, 07 May 2012 16:29:56 +0000</pubDate>
		<dc:creator>Andrew Brown</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://monsterboxpro.com/blog/?p=316</guid>
		<description><![CDATA[I&#8217;ve had friends, colleagues and previous co-workers who wrote such wonderful articles that they were fortunate enough to appear at the top of hacker news. What they didn&#8217;t do was ask me to vote up their article. This week I&#8217;ve been &#8216;spammed&#8217; 3 times via email to vote up truly mediocre content posted onto hacker [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had friends, colleagues and previous co-workers who wrote such wonderful articles that they were fortunate enough to appear at the top of hacker news. What they didn&#8217;t do was ask me to vote up their article.</p>
<p>This week I&#8217;ve been &#8216;spammed&#8217; 3 times via email to vote up truly mediocre content posted onto hacker news. I think if you&#8217;re going to bother people to vote for you, you should at the very least ask them what they consider worthy of your vote. </p>
<p>They don&#8217;t see hacker news as a source of knowledgeable material for themselves but a media channel they can exploit. If you&#8217;re going to succumb to spamming your mailing list, you might as well do it proper and pay for crowsourced votes for the position of numbero uno.</p>
]]></content:encoded>
			<wfw:commentRss>http://monsterboxpro.com/blog/2012/05/07/vote-up-this-on-hacker-news/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql count all duplicates based on a field</title>
		<link>http://monsterboxpro.com/blog/2011/10/02/mysql-count-all-duplicates-based-on-a-field/</link>
		<comments>http://monsterboxpro.com/blog/2011/10/02/mysql-count-all-duplicates-based-on-a-field/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 03:20:07 +0000</pubDate>
		<dc:creator>Andrew Brown</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://monsterboxpro.com/blog/?p=295</guid>
		<description><![CDATA[I always forget this so I&#8217;m just going to micro blog about it here. select email, count(email) as c from users group by email having c > 1 order by c;]]></description>
			<content:encoded><![CDATA[<p>I always forget this so I&#8217;m just going to micro blog about it here.</p>
<p>select email, count(email) as c from users group by email having c > 1 order by c;</p>
]]></content:encoded>
			<wfw:commentRss>http://monsterboxpro.com/blog/2011/10/02/mysql-count-all-duplicates-based-on-a-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Backup and Restore Mysql Database</title>
		<link>http://monsterboxpro.com/blog/2011/06/03/how-to-backup-and-restore-mysql-database/</link>
		<comments>http://monsterboxpro.com/blog/2011/06/03/how-to-backup-and-restore-mysql-database/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 02:23:27 +0000</pubDate>
		<dc:creator>Andrew Brown</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://monsterboxpro.com/blog/?p=291</guid>
		<description><![CDATA[Backup mysqldump -u > -p eg. mysqldump -u root teacherseat_dev > teacherseat.sql -p Restore mysql -u < -p eg. mysql -u root teacherseat_dev < teacherseat.sql -p]]></description>
			<content:encoded><![CDATA[<h2>Backup</h2>
<p>mysqldump -u <username> <database_name> > <file> -p</p>
<p>eg.<br />
mysqldump -u root teacherseat_dev > teacherseat.sql -p</p>
<h2>Restore</h2>
<p>mysql -u <username> <database_name> < <file> -p</p>
<p>eg.<br />
mysql -u root teacherseat_dev < teacherseat.sql -p</p>
]]></content:encoded>
			<wfw:commentRss>http://monsterboxpro.com/blog/2011/06/03/how-to-backup-and-restore-mysql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Clear all Whitespace in Vim</title>
		<link>http://monsterboxpro.com/blog/2011/05/21/how-to-clear-all-whitespace-in-vim/</link>
		<comments>http://monsterboxpro.com/blog/2011/05/21/how-to-clear-all-whitespace-in-vim/#comments</comments>
		<pubDate>Sat, 21 May 2011 23:59:23 +0000</pubDate>
		<dc:creator>Andrew Brown</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://monsterboxpro.com/blog/?p=289</guid>
		<description><![CDATA[All you need to do is type: :%s/\s\+$// But what I think you really want to do is add this to your .vimrc file. map cw :%s/\s\+$// Then you can just type \cw and it will clear all whitespace in your current file.]]></description>
			<content:encoded><![CDATA[<p>All you need to do is type:</p>
<p>:%s/\s\+$//</p>
<p>But what I think you really want to do is add this to your .vimrc file.</p>
<p>map <Leader>cw :%s/\s\+$//<CR></p>
<p>Then you can just type </p>
<p>\cw </p>
<p>and it will clear all whitespace in your current file.</p>
]]></content:encoded>
			<wfw:commentRss>http://monsterboxpro.com/blog/2011/05/21/how-to-clear-all-whitespace-in-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Always Have this Year in Your WordPress Footer</title>
		<link>http://monsterboxpro.com/blog/2011/03/01/always-have-this-year-in-your-wordpress-footer/</link>
		<comments>http://monsterboxpro.com/blog/2011/03/01/always-have-this-year-in-your-wordpress-footer/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 20:24:48 +0000</pubDate>
		<dc:creator>Andrew Brown</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://monsterboxpro.com/blog/?p=278</guid>
		<description><![CDATA[The year has changed, but your footer hasn&#8217;t. One minor adjustment and you&#8217;ll never have to worry about that year being out of date again. This is what we&#8217;re going to add &#60;?php echo date&#40;'Y'&#41; ?&#62; Your footer code will look a bit different from mine, but just open footer.php in your wordpress template, and [...]]]></description>
			<content:encoded><![CDATA[<p>The year has changed, but your footer hasn&#8217;t. One minor adjustment and you&#8217;ll never have to worry about that year being out of date again.</p>
<p>This is what we&#8217;re going to add</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;?php echo date<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">&#41;</span> ?&gt;</span></pre></div></div>

<p>Your footer code will look a bit different from mine, but just open footer.php in your wordpress template, and replace the year with the line of code above, you&#8217;ll never have to update your footer again.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;footer&quot;</span>&gt;</span>
          <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
            <span style="color: #009900;">&lt;?php echo date<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Y'</span><span style="color: #66cc66;">&#41;</span> ?&gt;</span> <span style="color: #ddbb00;">&amp;copy;</span> Monsterbox Productions
          <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- footer --&gt;</span>        
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- wrapper --&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- container --&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://monsterboxpro.com/blog/2011/03/01/always-have-this-year-in-your-wordpress-footer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Join three table together in MySQL. Left Join Maddness!!!</title>
		<link>http://monsterboxpro.com/blog/2011/03/01/mysql-how-to-join-three-table-together-left-join-maddness/</link>
		<comments>http://monsterboxpro.com/blog/2011/03/01/mysql-how-to-join-three-table-together-left-join-maddness/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 19:22:26 +0000</pubDate>
		<dc:creator>Andrew Brown</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://monsterboxpro.com/blog/?p=261</guid>
		<description><![CDATA[The Problem I&#8217;m building a web-app with groups. There are a bunch of links in the group, and you can star, comment thumb them up. Then there is a page that shows who has starred, commented and thumbed things. Basically like digg or reddit. So that means I need to join three tables together: group_shared_links [...]]]></description>
			<content:encoded><![CDATA[<h2>The Problem</h2>
<p>I&#8217;m building a web-app with groups. There are a bunch of links in the group, and you can star, comment thumb them up. Then there is a page that shows who has starred, commented and thumbed things. Basically like digg or reddit.</p>
<p>So that means I need to join three tables together:</p>
<p>group_shared_links<br />
shared_links<br />
links</p>
<p>It may sound dumb but I didn&#8217;t learn how to use join&#8217;s recently. Never had to, so if your in the same boat that I was in, I hope I can save you time learning how to do this with my example. </p>
<p><strong>Comp dead, new one coming in at end of week, this article will be finished first week of March</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://monsterboxpro.com/blog/2011/03/01/mysql-how-to-join-three-table-together-left-join-maddness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keep Track of your Z-Indexes with Sass Variables</title>
		<link>http://monsterboxpro.com/blog/2010/11/22/keep-track-of-your-z-indexes-with-sass-variables/</link>
		<comments>http://monsterboxpro.com/blog/2010/11/22/keep-track-of-your-z-indexes-with-sass-variables/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 14:49:42 +0000</pubDate>
		<dc:creator>Andrew Brown</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://monsterboxpro.com/blog/?p=198</guid>
		<description><![CDATA[When I add z-indexes I try to be modest with my numbers eg. (1,5,10,100) but then in the midst of working my numbering scheme falls apart and I&#8217;ll end up with numbers such as eg.(80,79,70,1000,9999,9999,85). So what I&#8217;ve done is added in my application.sass all my z-indexes as variables: /* z-indexes $z_block_area_wrap: 999999 $z_tipsy: 100000 [...]]]></description>
			<content:encoded><![CDATA[<p>When I add z-indexes I try to be modest with my numbers eg. (1,5,10,100) but then in the midst of working my numbering scheme falls apart and I&#8217;ll end up with numbers such as eg.(80,79,70,1000,9999,9999,85).</p>
<p>So what I&#8217;ve done is added in my application.sass all my z-indexes as variables:</p>

<div class="wp_syntax"><div class="code"><pre class="sass" style="font-family:monospace;">/* z-indexes
$z_block_area_wrap:      999999
$z_tipsy:                100000
$z_options_wrap:         99999
$z_options:              99999
$z_user_options_drop:    99998
$z_expanded:             9999
$welcome_close:          2005
$z_header_wrap:          2000
$z_item_close:           2000
$z_welcome:              1999
$z_actionables:          1999
$z_library_mass_actions: 1999
$z_drag_handle:          30
$z_name:                 20
$z_icon:                 10
$z_items_count:          30
$z_column_wrap:          10
$z_wrapper:              10
$z_loading_graphic:      10</pre></div></div>

<p>Now I can readjust these numbers so they are more sane and from now on I&#8217;ll never be confused about what number to use for my z-indexes again.</p>
]]></content:encoded>
			<wfw:commentRss>http://monsterboxpro.com/blog/2010/11/22/keep-track-of-your-z-indexes-with-sass-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically include all paramaters into render locals</title>
		<link>http://monsterboxpro.com/blog/2010/05/04/tired-out-typing-out-the-locals-hash-in-render-statements/</link>
		<comments>http://monsterboxpro.com/blog/2010/05/04/tired-out-typing-out-the-locals-hash-in-render-statements/#comments</comments>
		<pubDate>Tue, 04 May 2010 09:35:45 +0000</pubDate>
		<dc:creator>Tye Shavik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://monsterboxpro.com/blog/?p=137</guid>
		<description><![CDATA[We use helpers to refactor our render statements and we end up with a lot of helpers like this: def comment_fields&#40;f,course,discussion,comment&#41; render :partial =&#62; 'comments/fields', :locals =&#62; &#123; :f =&#62; f, :course =&#62; course, :discussion =&#62; discussion, :comment =&#62; comment &#125; end In these helpers you&#8217;re typing out each variable name 3 times, once in [...]]]></description>
			<content:encoded><![CDATA[<p>We use helpers to refactor our render statements and we end up with a lot of helpers like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> comment_fields<span style="color:#006600; font-weight:bold;">&#40;</span>f,course,discussion,comment<span style="color:#006600; font-weight:bold;">&#41;</span>
  render <span style="color:#ff3333; font-weight:bold;">:partial</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'comments/fields'</span>,
    <span style="color:#ff3333; font-weight:bold;">:locals</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> 
      <span style="color:#ff3333; font-weight:bold;">:f</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> f,
      <span style="color:#ff3333; font-weight:bold;">:course</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> course,
      <span style="color:#ff3333; font-weight:bold;">:discussion</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> discussion,
      <span style="color:#ff3333; font-weight:bold;">:comment</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> comment <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>In these helpers you&#8217;re typing out each variable name 3 times, once in the function definition and twice in the locals hash. Wouldn&#8217;t it be great if you only had to type the name of the variables in the definition and have the local hash generated automatically? Well we&#8217;ve created a nifty helper called <tt>locals</tt> that will do just that. It works like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> comment_fields<span style="color:#006600; font-weight:bold;">&#40;</span>f,course,discussion,comment<span style="color:#006600; font-weight:bold;">&#41;</span>
  render <span style="color:#ff3333; font-weight:bold;">:partial</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'comments/fields'</span>,
    <span style="color:#ff3333; font-weight:bold;">:locals</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> locals<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">binding</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The <a href="http://ruby-doc.org/core/classes/Kernel.html#M005946"><tt>binding</tt></a> object is built-in to Ruby and allows you to access a list of variable names in the local scope. The <tt>locals</tt> helper will use this object to generate a hash of variables that you can pass to the <tt>render</tt> function.</p>
<p>You will need to put this function in your application_helper.rb:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> locals<span style="color:#006600; font-weight:bold;">&#40;</span>helper_binding,<span style="color:#006600; font-weight:bold;">*</span>locals<span style="color:#006600; font-weight:bold;">&#41;</span>
  options = locals.<span style="color:#9900CC;">extract_options</span>!
  result = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
  vars = <span style="color:#CC0066; font-weight:bold;">eval</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;local_variables&quot;</span>,helper_binding<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">for</span> var <span style="color:#9966CC; font-weight:bold;">in</span> vars
    result<span style="color:#006600; font-weight:bold;">&#91;</span>var.<span style="color:#9900CC;">to_sym</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#CC0066; font-weight:bold;">eval</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{var}&quot;</span>,helper_binding<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  result.<span style="color:#9900CC;">merge</span><span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p><tt>locals(binding)</tt> will grab all the local variables that exist at the time it&#8217;s evaluated (not just the variables that are in the function definition). You can pass a hash to <tt>locals</tt> to specify additional variables to pass. </p>
<p>So for example this code:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> comment_fields<span style="color:#006600; font-weight:bold;">&#40;</span>f,course,discussion,comment<span style="color:#006600; font-weight:bold;">&#41;</span>
  user = comment.<span style="color:#9900CC;">user</span>
  render <span style="color:#ff3333; font-weight:bold;">:partial</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'comments/fields'</span>,
    <span style="color:#ff3333; font-weight:bold;">:locals</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> locals<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">binding</span>,
      <span style="color:#ff3333; font-weight:bold;">:comment_count</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> discussion.<span style="color:#9900CC;">comments</span>.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Is the same as:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> comment_fields<span style="color:#006600; font-weight:bold;">&#40;</span>f,course,discussion,comment<span style="color:#006600; font-weight:bold;">&#41;</span>
  render <span style="color:#ff3333; font-weight:bold;">:partial</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'comments/fields'</span>,
    <span style="color:#ff3333; font-weight:bold;">:locals</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> 
      <span style="color:#ff3333; font-weight:bold;">:user</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> comment.<span style="color:#9900CC;">user</span>,
      <span style="color:#ff3333; font-weight:bold;">:f</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> f,
      <span style="color:#ff3333; font-weight:bold;">:course</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> course,
      <span style="color:#ff3333; font-weight:bold;">:discussion</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> discussion,
      <span style="color:#ff3333; font-weight:bold;">:comment</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> comment,
      <span style="color:#ff3333; font-weight:bold;">:comment_count</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> discussion.<span style="color:#9900CC;">comments</span>.<span style="color:#9900CC;">length</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://monsterboxpro.com/blog/2010/05/04/tired-out-typing-out-the-locals-hash-in-render-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regular expressions sub/gsub for JQuery</title>
		<link>http://monsterboxpro.com/blog/2010/03/09/regular-expressions-subgsub-for-jquery/</link>
		<comments>http://monsterboxpro.com/blog/2010/03/09/regular-expressions-subgsub-for-jquery/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 06:34:06 +0000</pubDate>
		<dc:creator>Andrew Brown</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gsub]]></category>
		<category><![CDATA[javascript. sub]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://monsterboxpro.com/blog/?p=104</guid>
		<description><![CDATA[I spent 1.5 hours searching the Internet and the JQuery docs to figure out how to perform sub or gsub on a string with a regular expression. I had to use a crazy mix of keywords to find the answer. Hopefully this blog post gets index on Google so the next person looking to do [...]]]></description>
			<content:encoded><![CDATA[<p>I spent 1.5 hours searching the Internet and the JQuery docs to figure out how to perform sub or gsub on a string with a regular expression. I had to use a crazy mix of keywords to find the answer. Hopefully this blog post gets index on Google so the next person looking to do regular expressions in JQuery doesn&#8217;t have to waste so much time looking for the sub or gsub equivalent because the JQuery people can&#8217;t stick to programming conventions that makes sense and are already known by most programmers. This is a case of unnecessary naming cleverness. Give me back my time JQuery, you time vampire.</p>
<p>Oh, let us not forget the solution:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #3366CC;">&quot;This is a test&quot;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/test/</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'an explosion'</span><span style="color: #009900;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://monsterboxpro.com/blog/2010/03/09/regular-expressions-subgsub-for-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to properly commit to your git repository (rebasing)</title>
		<link>http://monsterboxpro.com/blog/2010/02/22/how-to-properly-commit-to-your-git-repository-rebasing/</link>
		<comments>http://monsterboxpro.com/blog/2010/02/22/how-to-properly-commit-to-your-git-repository-rebasing/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 07:36:34 +0000</pubDate>
		<dc:creator>Andrew Brown</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[clean]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[proper]]></category>
		<category><![CDATA[rebase]]></category>

		<guid isPermaLink="false">http://monsterboxpro.com/blog/?p=60</guid>
		<description><![CDATA[To be a professional Ruby on Rails developer you need to properly commit your changes to the git repos without making a big mess. Compare the two git trees below. The problem is when your working with multiple people on a git repos you can&#8217;t work in master otherwise when you pull changes, you&#8217;ll have [...]]]></description>
			<content:encoded><![CDATA[<p>To be a professional Ruby on Rails developer you need to properly commit your changes to the git repos without making a big mess. Compare the two git trees below.</p>
<p><img src="http://monsterboxpro.com/blog/wp-content/uploads/2010/02/compare_commits1.png" alt="Comparing messy commits with clean commits" /></p>
<p>The problem is when your working with multiple people on a git repos you can&#8217;t work in master otherwise when you pull changes, you&#8217;ll have a messy merge and when you push you&#8217;ll make a bunch of messy lines in your git tree, and you&#8217;ll get yelled at for making those messy lines.</p>
<p>I want to go through the steps with you to get your git tree to look like one straight line. Look at the model below to understand what you need to do.</p>
<p><img src="http://monsterboxpro.com/blog/wp-content/uploads/2010/02/commit.png" alt="Perfect Git Commit Model"  /></p>
<p><strong>Lets go through the step of adding a new feature:</strong></p>
<p> Make sure we&#8217;re on master</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">git checkout master</pre></div></div>

<p>Make sure our master is up-to-date</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">git pull</pre></div></div>

<p>Create a new branch called new_feature</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">git checkout -b new_feature</pre></div></div>

<p>Make changes and commit as much as you want</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">git commit</pre></div></div>

<p><strong>1.</strong> Now we&#8217;re ready to push our changes so lets make sure our<br />
master is up-to-date</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">git checkout master
git pull</pre></div></div>

<p><strong>2.</strong> Lets rebase (If everything was up-to-date skip this step)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">git checkout new_feature
git rebase master</pre></div></div>

<p><strong>3.</strong> Merge new_feature into your master</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">git checkout master
git merge new_feature</pre></div></div>

<p><strong>4.</strong> Push changes</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">git push</pre></div></div>

<p>That&#8217;s all there is to it! Single clean line, nobody is yelling at you, and you can make fun of your coding friends who have never rebased before.</p>
]]></content:encoded>
			<wfw:commentRss>http://monsterboxpro.com/blog/2010/02/22/how-to-properly-commit-to-your-git-repository-rebasing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

