<?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>Laughing Meme &#187; tips</title>
	<atom:link href="http://laughingmeme.org/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://laughingmeme.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 29 Jan 2012 21:54:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Photojojo &#8211; like Make/Readymade, but just for your camera</title>
		<link>http://laughingmeme.org/2006/04/05/photojojo-like-makereadymade-but-just-for-your-camera/</link>
		<comments>http://laughingmeme.org/2006/04/05/photojojo-like-makereadymade-but-just-for-your-camera/#comments</comments>
		<pubDate>Wed, 05 Apr 2006 21:31:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[friends]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=3315</guid>
		<description><![CDATA[Kara and Amit&#8217;s new project is off to a great start.]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/karacanal/">Kara</a> and <a href="http://flickr.com/photos/superamit/">Amit&#8217;s</a> new project is off to a great start.</p>
<p><a href='http://photojojo.com/'>http://photojojo.com/</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2006/04/05/photojojo-like-makereadymade-but-just-for-your-camera/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some Rails Tips (Especially for OS X Hackers)</title>
		<link>http://laughingmeme.org/2005/04/01/some-rails-tips-especially-for-os-x-hackers/</link>
		<comments>http://laughingmeme.org/2005/04/01/some-rails-tips-especially-for-os-x-hackers/#comments</comments>
		<pubDate>Fri, 01 Apr 2005 15:01:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=1052</guid>
		<description><![CDATA[The last thing on earth the web needs right now, is another blog/blog post about another developer stumbling his way up the admittedly short Rails learning curve. Still, here a few tips, especially for the newbie Rails and OS X hackers. Use Breakpoint Breakpointer is great. Took me a little while to figure out how [...]]]></description>
			<content:encoded><![CDATA[<p>The last thing on earth the web needs right now, is another blog/blog post about another developer stumbling his way up the admittedly short Rails learning curve.  Still, here a few tips, especially for the newbie Rails and OS X hackers. </p>

<h3>Use Breakpoint</h3>

<p><a href="http://ruby-breakpoint.rubyforge.org">Breakpointer</a> is great.  Took me a little while to figure out how it worked as I was expect something like <code>gdb</code>, while <code>breakpointer</code> is really more of a evolutionary punctuated equilibrium from the <a href="http://www.tbray.org/ongoing/When/200x/2004/06/17/DeDebPrint">scattering &#8216;print&#8217; statements through out the code</a> style of debugging.  Instead of</p>

<pre><code>print "going into crashing_function"
crashing\_function(var1, var2, var3)
print "after crashing_function"
</code></pre>

<p>You say</p>

<pre><code>breakpoint "going into crashing_function"
crashing_function(var1, var2, var3)
</code></pre>

<p>And when <code>breakpoint</code> is reached you&#8217;re dropped into an <a href="http://www.rubygarden.org/ruby?Irb">irb</a> shell, and can inspect those variables, call methods, and generally re-write your code on the fly.</p>

<p>What you can&#8217;t do is step.  So if you&#8217;re interested in what is going on in crashing&#95;function you&#8217;ll need something like</p>

<pre><code>def crashing_function(var1, var2, var3)
   breakpoint "start of crashing function"
   ...
   breakpoint "end of crashing function"
end
</code></pre>

<p>But how you ask does a web app bring up an interactive shell?  In your Rails <code>script</code> directory (where <code>generate</code> and <code>server</code> are) you&#8217;ll find <code>breakpointer</code>.  Simply run it, and it will attempt to connect to a dRB server that Rails in development mode brings up behind the scenes.  You&#8217;ll see</p>

<pre><code>No connection to breakpoint service at druby://localhost:42531
       (DRb::DRbConnError)
Tries to connect will be made every 2 seconds...
</code></pre>

<p>Now go hit your web app over on localhost:3000, and when you reach a breakpoint you&#8217;ll see your app hang, and the little spinning loading icon go on and on and on.  This is your clue to switch back to the terminal where you ran breakpointer</p>

<p>There instead of &#8216;No connection&#8217; you&#8217;ll see</p>

<pre><code>Executing break point "start of crashing function" at 
      ./script/../config/..//app/models/crashme.rb:15 in `crashing_function'
</code></pre>

<p>That is: you&#8217;re breakpoint, the file, and the name of the function.  From here you can do things like </p>

<pre><code>puts var1
var1.inspect
self.some_state.inspect
</code></pre>

<p>And <a href="http://ruby-breakpoint.rubyforge.org/wiki/wiki.pl?TipsAndTricks">lots more stuff</a> which I haven&#8217;t really started playing with.  What you can&#8217;t do is <code>next</code>, <code>step</code>, <code>run</code>, etc.  When you&#8217;re tired of the view from this breakpoint, and are ready to be whisked away to the next one, type</p>

<p>exit</p>

<h3>SecurityError (Insecure operation &#8216;write&#8217; at level 4)</h3>

<p>What if all that doesn&#8217;t happen.  What if your browser doesn&#8217;t seem to go into a spinning death spiral but instead promptly pops up the error message like <code>SecurityError (Insecure operation 'write' at level 4)</code>.  The default answer is you need Ruby 1.8.2 instead of Ruby 1.8.1.  &#8220;But&#8221;, I hear you say, &#8220;I&#8217;ve already got Ruby 1.8.2&#8243;.  At which all the wise heads on on #rubyonrails will nod sagely, and says, &#8220;Yes, grasshopper, but you are a Mac user, and have the wrong 1.8.2.&#8221;.  Basically the .dmg was silently upgraded, and you&#8217;ll need to <a href="http://homepage.mac.com/discord/Ruby/">re-download</a> and re-install it.</p>

<h3>Living With Your Model / Using CocoaMySQL</h3>

<p>I&#8217;ve been using MySQL for 8+ years now, and to say I&#8217;m pretty comfortable with the <code>mysql</code> command line client is an understatement. (though I&#8217;ve never <a href="http://jeremy.zawodny.com/blog/archives/002230.html">tricked it out like Jeremy</a>)  That said, working with Rails where a significant portion of your applications logic is inferred directly from the database means you spend a <strong>lot</strong> of time living in the database.  And so for the first time ever, I went looking for a graphical MySQL client, and found <a href="http://cocoamysql.sourceforge.net/">CocoaMySQL</a>.  It works well with a lot of room for improvement, but my one critical tip for you is, if you&#8217;re working with a dataset of any size, go to Preferences and make sure to check &#8220;Limit results to 100 rows&#8221; or you&#8217;re going to be dealing with a bad case of the spinnies. (and unlike the breakpointer tip, this is not desirable)</p>

<h3>gem_server</h3>

<p>How do you get a neat, JavaDoc-y looking document site like <a href="http://rails.rubyonrails.com">rails.rubyonrails.com</a>?  As far as I can tell you don&#8217;t.  But the next best thing is <code>gem_server</code>.  Just run it from the command line, and it will bring up another instance of WEBrick, this one on port 8808, browse to it, and boom, you&#8217;ve got docs for all installed <code>gems</code>. (admittedly all versions of all installed gems, which gets a little ugly)</p>

<p>Thats what I&#8217;ve picked up so far, most of it unfolded fairly rapidly, but if I can pass along the accumulated wisdom of a couple of hours, there you go.</p>

<p><strong>update:</strong> a recipe for <a href="http://article.gmane.org/gmane.comp.lang.ruby.rails/6047">generating Rails docs with Rdoc</a></p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2005/04/01/some-rails-tips-especially-for-os-x-hackers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gaming Heathrow</title>
		<link>http://laughingmeme.org/2005/01/15/gaming-heathrow/</link>
		<comments>http://laughingmeme.org/2005/01/15/gaming-heathrow/#comments</comments>
		<pubDate>Sat, 15 Jan 2005 22:19:53 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=2763</guid>
		<description><![CDATA[Brilliant! Also includes some notes about that Clarke book]]></description>
			<content:encoded><![CDATA[<p>Brilliant!  Also includes some notes about that Clarke book</p>
<p><a href='http://www.tbray.org/ongoing/When/200x/2005/01/15/StrangeNorrell'>http://www.tbray.org/ongoing/When/200x/2005/01/15/StrangeNorrell</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2005/01/15/gaming-heathrow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Think like Gramsci, talk like Debs</title>
		<link>http://laughingmeme.org/2005/01/11/think-like-gramsci-talk-like-debs/</link>
		<comments>http://laughingmeme.org/2005/01/11/think-like-gramsci-talk-like-debs/#comments</comments>
		<pubDate>Tue, 11 Jan 2005 19:38:29 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[macleod]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[propaganda]]></category>
		<category><![CDATA[theory]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=2755</guid>
		<description><![CDATA[Ken MacLeod on &#8216;framing&#8217;, and a left/progressive real politick]]></description>
			<content:encoded><![CDATA[<p>Ken MacLeod on &#8216;framing&#8217;, and a left/progressive real politick</p>
<p><a href='http://kenmacleod.blogspot.com/2004_11_01_kenmacleod_archive.html#110003483936259215'>http://kenmacleod.blogspot.com/2004_11_01_kenmacleod_archive.html#110003483936259215</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2005/01/11/think-like-gramsci-talk-like-debs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CocoViewX &#8211; faster and lighter then iPhoto</title>
		<link>http://laughingmeme.org/2004/12/29/cocoviewx-faster-and-lighter-then-iphoto/</link>
		<comments>http://laughingmeme.org/2004/12/29/cocoviewx-faster-and-lighter-then-iphoto/#comments</comments>
		<pubDate>Wed, 29 Dec 2004 18:26:23 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=2732</guid>
		<description><![CDATA[excellent David Lanham icon doesn&#8217;t quite save it from ugliness, but it works well]]></description>
			<content:encoded><![CDATA[<p>excellent David Lanham icon doesn&#8217;t quite save it from ugliness, but it works well</p>
<p><a href='http://www.macosxhints.com/article.php?story=20041229061532734'>http://www.macosxhints.com/article.php?story=20041229061532734</a></p>]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2004/12/29/cocoviewx-faster-and-lighter-then-iphoto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

