
<?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>RubyGeek</title>
	<atom:link href="http://www.rubygeek.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rubygeek.com</link>
	<description>Ruby, Javascript, etc</description>
	<lastBuildDate>Thu, 05 Jul 2012 14:31:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Screen Multiplexing == Productivity</title>
		<link>http://www.rubygeek.com/2012/02/26/screen-multiplexing-productivity/</link>
		<comments>http://www.rubygeek.com/2012/02/26/screen-multiplexing-productivity/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 14:27:01 +0000</pubDate>
		<dc:creator>nola</dc:creator>
				<category><![CDATA[cool toys]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[time management]]></category>

		<guid isPermaLink="false">http://www.rubygeek.com/?p=232</guid>
		<description><![CDATA[A few friends have been telling me about tmux and since I&#8217;ve been using a mac full time again (rather than ssh into linux) I haven&#8217;t used a screen multiplexer. I wrote awhile back about Getting around with GNU Screen&#8221; and I really liked screen. I was listening to Changelog&#8217;s podcast Episode 0.7.3 &#8211; Tmux [...]]]></description>
			<content:encoded><![CDATA[<p>A few friends have been telling me about tmux and since I&#8217;ve been using a mac full time again (rather than ssh into linux) I haven&#8217;t used a screen multiplexer. I wrote awhile back about <a href="http://www.rubygeek.com/2010/07/16/getting-around-with-gnu-screen/">Getting around with GNU Screen&#8221;</a> and I really liked screen. I was listening to Changelog&#8217;s podcast <a href="http://thechangelog.com/post/17827235767/episode-0-7-3-tmux-with-brian-hogan-and-josh-clayton">Episode 0.7.3 &#8211; Tmux with Brian Hogan and Josh Clayton</a> on one of my walks, it seemed useful and better than screen. Then I remembered hey it was kind of useful to use a screen multiplexer (BTW, I love saying multiplexer. I feel smart, like I know what I am talking about, hehe). I got home from my walk and installed it and started with the links on the changelog show notes and not wanting to get overwhemed by just copying someone conf file, I started simple and added a few things:</p>
<p><code><br />
# change default command sequence·<br />
unbind C-b<br />
set-option -g prefix C-a </p>
<p># Start Window Numbering at 1<br />
set -g base-index 1</p>
<p># Faster Command Sequences<br />
set -s escape-time 0</p>
<p># force a reload of the config file<br />
unbind r<br />
bind r source-file ~/.tmux.conf</p>
<p># quick pane cycling<br />
unbind ^A<br />
bind ^A select-pane -t :.+<br />
</code></p>
<p>I used the default from screen, ctrl-a to go into command mode. Since that the combo used for screen, it seemed like a good idea. The second setting sets the numbering at 1, arguement for that is the 1 is probably closer to where you are typing and certainly closer to ctrl-a</p>
<p>The next 3 were just something I found, seemed like they&#8217;d be ok. Then i stopped adding to the conf and started trying it out.</p>
<p>I often alternate between textmate and macvim. I remembered from the podcast that one of the guys now just does entirely vim. Meh ok, I only like a few of the things in macvim, mostly scrolling and clicking to change panes. So i opened my project up and started working away. </p>
<p>I had a hard time figuring out how to get the split that one of the guys talked about, so once I found it made note of it:</p>
<p><code><br />
ctrl-a :<br />
 split-window -p 25<br />
</code></p>
<p>I used this page alot and copy and pasted some things to my own cheatsheet</p>
<p><a href="http://robots.thoughtbot.com/post/2641409235/a-tmux-crash-course">Thoughtbot &#8211; A tmux crash course</a></p>
<p>One thing I really like is named sessions so I can have my own workspaces</p>
<p><code><br />
tmux list-sessions<br />
fun: 3 windows (created Sat Feb 18 16:10:58 2012) [156x37]<br />
koans: 1 windows (created Wed Feb 22 11:06:36 2012) [156x36]<br />
work: 3 windows (created Sat Feb 18 16:38:46 2012) [156x37]<br />
</code></p>
<p>Great to remember what you were doing last! </p>
<p>Fun is where I work on something fun. I was digging into rails activesupport source code and reading the tests. koans is where I work through rubykoans (having it in a session makes it quick to switch and work on a few at a time). Its split down the middle with my console on one side and the code on the other. Work is well work <img src='http://www.rubygeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I have it split 75/25 with vim at the top, and bottom is just the shell where i type my git commands, ack/grep. I have a second window with my rails server log going. </p>
<p>I even found a <a href="https://github.com/squil/pomodoro.rb">pomodoro timer</a> that runs in the console.</p>
<p>Its working out good. I&#8217;ve started to work fullscreen  and keep clutter out of slight.  I think its a smoother flow than screen and I wish I had dived in sooner. </p>
<p>If you haven&#8217;t tried a screen multiplexer give it a shot! Remember to start with a few commands at a time so you dont get overwhelmed! </p>
<p>Edited to add:<br />
Tmux remote pairing scripts<br />
<a href="https://github.com/mikehowson/tmux-remote-pairing-scripts">https://github.com/mikehowson/tmux-remote-pairing-scripts</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubygeek.com/2012/02/26/screen-multiplexing-productivity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MongoDB Austin 2012</title>
		<link>http://www.rubygeek.com/2012/02/18/mongodb-austin-2012/</link>
		<comments>http://www.rubygeek.com/2012/02/18/mongodb-austin-2012/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 04:44:37 +0000</pubDate>
		<dc:creator>nola</dc:creator>
				<category><![CDATA[mongo]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.rubygeek.com/?p=215</guid>
		<description><![CDATA[I went to the MongoDB Conference in Austin, put on by 10Gen.com on Feb 15th. There was almost 250 in attendance. The venue was great, Norris Convention Center in North Austin. I learned what I dont know and received clarification on things that were a little fuzzy in my little brain regarding nosql and mongo. [...]]]></description>
			<content:encoded><![CDATA[<p>I went to the MongoDB Conference in Austin, put on by <a href=”http://10Gen.com”>10Gen.com</a> on Feb 15th. There was almost 250 in attendance. The venue was great, <a href="http://norriscenters.com/">Norris Convention Center</a> in North Austin. I learned what I dont know and received clarification on things that were a little fuzzy in my little brain regarding nosql and mongo.</p>
<p>Here’s a summary of the talks I went to:</p>
<p><strong>Welcome and What&#8217;s New in MongoDB &#8211; Paul Pederson</strong><br />
This talk went over by about 9 minutes and sort of set off the whiners on twitter all day with complaints (real classy guys, real classy). It wasn’t too bad really, but I hope he plans this talk out a little better next time he gives it. As he reached the end of his timeslot, he showed no signs of wrapping up. It was mostly an overview and I wrote down a few interesting things. One was &#8220;relational model is not optimized for monolithic systems&#8221; which puts mongo in perspective of when you might use it.  He explains <a href="http://bsonspec.org/">BSON</a> as JSON, but bigger and actual data types. Here&#8217;s a slide I particularly enjoyed:</p>
<p><img src="http://www.rubygeek.com/wp-content/uploads/photo-2.jpg" alt="webscale" /></p>
<p>Some friends and I joke around about Mongodb being &#8220;web scale&#8221; &#8211; watch this funny video <a href="http://www.youtube.com/watch?v=b2F-DItXtZs">http://www.youtube.com/watch?v=b2F-DItXtZs</a> (its all in good fun, redirect your hate mail to /dev/null please which is also web scale by the way <img src='http://www.rubygeek.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p><strong>Building Your First MongoDB Application, Mike O&#8217;Brien </strong>- This walked through schema for an app like foursquare. Using three collections users, places, checkins he walked through some javascript and queries and examples. He talked about indexes and compound indexes.  This was very good, excellent way to kick off the talks.</p>
<p><strong>Schema Design Principles and Practice, Kevin Hanson</strong> &#8211; Linking or embedding!?! This is something that is sometimes puzzling about nosql and when I see examples of linking and embedding. Whenever I saw &#8220;something_id&#8221; linking to a &#8220;something&#8221; table I&#8217;d think &#8220;SEE?? USE RDBMS!!! Why bother with nosql?&#8221; So as I understand it now, if a piece of data will be accessed infrequently then its ok to link it, if not then embed it. You have to really think about how you are going to access the data and how often. </p>
<p><strong>MongoDB on Amazon EC2, Sandeep Parikh</strong> &#8211; I haven&#8217;t done much with ec2 so alot of this was over my head. He did talk about if primary mongodb goes down then secondary becomes primary and will then take reads. Something I will have to read more about.</p>
<p><strong>Indexing and Query Optimization, Kevin Hanson </strong>- This was good because this is something I am weak on. I hardly ever add indexes in mysql, mostly because I haven&#8217;t taken the time to understand them beyond &#8220;primary keys need indexes&#8221;. Kevin gave examples of indexes and explained the syntax:</p>
<p><code><br />
db.blogs.ensureIndex({author: 1})<br />
</code><br />
The one is for 1 ascending and  -1 for descending</p>
<p>You can do a compound index<br />
<code><br />
db.blogs.ensureIndex({author: 1, ts: -1})<br />
</code><br />
You can use dot notation to index embedded values<br />
<code>User {<br />
name<br />
address { zipcode : 1234 }<br />
  }<br />
}</p>
<p>db.users.ensureIndex({address.zipcode : 1})  </code></p>
<p>Somethings to remember about indexes: </p>
<ul>
<li>will maintain order</li>
<li>will slow writes</li>
<li>takes up space</li>
<li>maintenance will cause writes</li>
</ul>
<p>unique parameter forces uniqueness<br />
<code>db.blogs.ensureInde({title: 1},{unique: true})</code></p>
<p>Sparse indexes will create a index and not store the absence of a value.<br />
<code>db.blogs.ensureInde({title: 1},{sparse: true})</code></p>
<p>This was a good talk and I learned alot!</p>
<p><strong>Mobilize Your MongoDB! Developing iPhone and Android Apps in the Cloud, Grant Shipley </strong>- This was my favorite talk, saw lots of code. I guess this shows where my passion is..programming vs db admin. Grant did a REST API in php and talked to it using Appcelerator Titanium. He walked through a bit of the ui code as well as showing it on iphone and android emulators. He deployed his app to Red Hat&#8217;s new service OpenShift, sort of like heroku. That was interesting to see&#8230;I&#8217;ll have to give it a shot and also give Titanium a go. </p>
<p><strong>How and When to Scale MongoDB with Sharding &#8211; Spencer Brody</strong><br />
This is another talk where I found out what I didn&#8217;t know. Few notes:<br />
Config server setup, (I think its called mongos) is made up of 3 machines, if anything fails they all go into read only mode. If a write fails it is rolled back so all three are kept in sync.</p>
<p>Sharding &#8211; sharding is done on a collection and each shard has a key. A chunk is a range of shared keyed values. Each chunk will be 64mb. Sharding doesnt mean each piece is next to each other, they may be spread out and later moved around to accodate say, hey 100 people with last name starting with A signed up, so, need to rearrange pices to even each shard out.</p>
<p><strong>Advanced Shell Tips and Tricks, Scott Hernandez</strong> &#8211; My second favorite talk of the day, is tips for working in mongo shell.<br />
Mongo Shell &#8211; an  embedded js interpreter</p>
<p>Valuable for:</p>
<ul>
<li> interactive development / prototype </li>
<li> debugging </li>
<li> profiling </li>
<li> testing script </li>
<li> regular expressions </li>
</ul>
<p>Getting the stats about a collection:</p>
<p><code>db.collection_name.stats()</code><br />
you can get something like:<br />
<code><br />
> db.unicorns.stats()<br />
{<br />
        "ns" : "learn.unicorns",<br />
        "count" : 4,<br />
        "size" : 556,<br />
        "avgObjSize" : 139,<br />
        "storageSize" : 8704,<br />
        "numExtents" : 1,<br />
        "nindexes" : 1,<br />
        "lastExtentSize" : 8704,<br />
        "paddingFactor" : 1,<br />
        "flags" : 1,<br />
        "totalIndexSize" : 8192,<br />
        "indexSizes" : {<br />
                "_id_" : 8192<br />
        },<br />
        "ok" : 1<br />
}<br />
</code></p>
<p>Later, after the talk during lunch I asked one of the people at my table how to get the max document size, he mentioned you can get the average size. This must be how you do it.</p>
<p>When doing queries in shell, it gives you 20 results and pages them (using the cursor) with a prompt. if you want to change the number use:</p>
<p>DBQuery.shellBatchSize=2 or whatever number you want</p>
<p>you can run the non interactive shell with:</p>
<p><code>mongod --eval "my awesome mongodb code"</code></p>
<p>you can execute a file containing mongoshell code with:</p>
<p><code>mogodb [file.js]</code><br />
run file and back to os</p>
<p><code>mogodb --shell [file.js]</code><br />
run file and stay in shell</p>
<p>also while in shell if you want to load a file:<br />
<code>load(file.js)</code></p>
<p>If you want something to load every time you start the shell (maybe some custom code you&#8217;ve written) you can put it in</p>
<p><code>.mongorc.js</code></p>
<p>Remember: every number is 64 bit floating point double, not integer</p>
<p>to see if server is up:</p>
<p><code>db.runCommand("ping")</code></p>
<p>Looks like:<br />
<code><br />
> db.runCommand("ping")<br />
{ "ok" : 1 }<br />
</code></p>
<p>Remember this is javascript, if you leave off the () at end of a function, you get to see the contents of the function<br />
<code><br />
> db.runCommand<br />
function (obj) {<br />
    if (typeof obj == "string") {<br />
        var n = {};<br />
        n[obj] = 1;<br />
        obj = n;<br />
    }<br />
    return this.getCollection("$cmd").findOne(obj);<br />
}<br />
</code></p>
<p>To see a list of commands you can use<br />
<code><br />
help<br />
</code></p>
<p>Handy functions to look up:<br />
printjson()<br />
tojson()<br />
forEach to iterate on arrays and cursors</p>
<p>While he was talking I was poking around on 10gen&#8217;s site and found a whole bunch of other talks by him, so I saved this in my notes for later browsing:</p>
<p><a href="http://www.10gen.com/presentations#speaker__scott_hernandez">http://www.10gen.com/presentations#speaker__scott_hernandez</a></p>
<p>The closing talk was by Peter who opened the conference and he talked about the roadmap. Some of this was pretty much over my head (but probably had the db admins on the edge of their seats) but one thing I took away was they are making something called the pipeline to build complex sets of data, Paul described it as using the unix tools cut, less, grep and piped together to craft a result. He did show some interesting examples through the tests&#8230;and I got all excited (I love tests if you didn&#8217;t know) and now I think I&#8217;d like to go poke around with them and try them out.</p>
<p>After party at Cover3 was pretty awesome and I got to talk to people who turned out knowing people I know. I got to chat with some of the 10gen folks. I was disappointed I didn&#8217;t see any of my peeps from ruby/rails there but I did find a former coworker and a friend. It was sort of odd though, being in a group that I didn&#8217;t know many people. I guess I just dont hang out with database nerds. I will have to visit the Austin Nosql group and get to know them!</p>
<p>If you see a correction let me know. I sometimes dont take very good notes while trying to listen at the same time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubygeek.com/2012/02/18/mongodb-austin-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RubyPair &#8211; Never Code Alone Again!</title>
		<link>http://www.rubygeek.com/2011/09/21/rubypair-never-code-alone-again/</link>
		<comments>http://www.rubygeek.com/2011/09/21/rubypair-never-code-alone-again/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 13:59:49 +0000</pubDate>
		<dc:creator>nola</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://www.rubygeek.com/?p=204</guid>
		<description><![CDATA[I was sitting at the Lone Star Ruby Conference and during one of the workshops the speaker mentioned we could find a pair programming partner for the next segment of the workshop. Being a little shy and the only person I knew there was with his co-worker, I thought it would sure be nice to [...]]]></description>
			<content:encoded><![CDATA[<p>I was sitting at the Lone Star Ruby Conference and during one of the workshops the speaker mentioned we could find a pair programming partner for the next segment of the workshop. Being a little shy and the only person I knew there was with his co-worker, I thought it would sure be nice to easily find a pair programming partner! During the break I had this idea and bought rubypair.com &#8230; I had hoped that during the conference I would find someone that also would share my vision and keep me on task to finish it. I had heard <a href="http://twitter.com/#!/elight">Evan Light</a> during his talk when he mentioned has has open &#8220;office hours&#8221; where you can make an appointment to pair with him. So I found him and told him of my idea. He liked it and we agreed to pair on rubypair on the last day of the conference. We were trying to get it done so we could demo at the lightning talks but we kept wanting to try new and shinies (rails 3.1, sass, compass, mongodb etc) that we didn&#8217;t make it in time! But we made some progress and said we&#8217;d pair remotely to work on it.</p>
<p>The next weekend we set up time to pair on it and we worked through somethings. I was pretty rubied out though having spent the weekend prior to Lone Star Ruby Conference at an <a href="http://www.fridaynighthacks.com/">all night-hack fest</a> in Austin. Evan took the bull by the horns (yes I live in texas now!) and worked out more kinks, <a href="http://twitter.com/#!/djbrowning">David Browning</a> did the logo and site design and Evan implemented it with SASS and Compass. Others helped out almost immediately and we had pull requests! We deployed <a href="http://rubypair.com">RubyPair.com</a> on Sept 3! See the <a href="http://rubypair.com/about">Contributors</a> list for the growing list of contributors.  </p>
<p>Give it look and never code alone!</p>
<p>Repo: https://github.com/rubypair/rubypair<br />
Tasks: https://github.com/rubypair/rubypair/issues</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubygeek.com/2011/09/21/rubypair-never-code-alone-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding an application config file to a rails project</title>
		<link>http://www.rubygeek.com/2011/07/16/adding-an-application-config-file-to-a-rails-project/</link>
		<comments>http://www.rubygeek.com/2011/07/16/adding-an-application-config-file-to-a-rails-project/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 20:05:01 +0000</pubDate>
		<dc:creator>nola</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://www.rubygeek.com/?p=198</guid>
		<description><![CDATA[Recently I worked on a project where I needed certain config variables for staging, production, test etc and I wanted to store all these in a yaml file. I could set them in the different environments files but I prefer them all in one file. Create a file in the config/initializers .. I called it [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I worked on a project where I needed certain config variables for staging, production, test etc and I wanted to store all these in a yaml file. I could set them in the different environments files but I prefer them all in one file. </p>
<p>Create a file in the config/initializers .. I called it 00_load_app_config.rb so I can be sure it gets loaded first. In it I have only a single line</p>
<div class="igBar"><span id="lruby-3"><a href="#" onclick="javascript:showPlainTxt('ruby-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-3">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">APP_CONFIG = YAML.<span style="color:#9900CC;">load_file</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">"#{Rails.root}/config/app_config.yml"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span>Rails.<span style="color:#9900CC;">env</span><span style="color:#006600; font-weight:bold;">&#93;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Then I create a yaml config file at config/app_config.yml</p>
<div class="igBar"><span id="lruby-4"><a href="#" onclick="javascript:showPlainTxt('ruby-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-4">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">base: &amp;common</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; company_name: 'The Awesomest Company Evar!'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; api_username: 'api_user'</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; api_password: 'bob123'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">development:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;&lt;: *common</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; api_hostname: 'http://api-development.<span style="color:#9900CC;">myawesomesite</span>.<span style="color:#9900CC;">com</span>'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twitter_app_key: 'fff'</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twitter_app_secret: 'fff'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">staging:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;&lt;: *common</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; api_hostname: 'http://staging-api.<span style="color:#9900CC;">myawesomesite</span>.<span style="color:#9900CC;">com</span>'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twitter_app_key: 'sss'</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twitter_app_secret: 'sss'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">test</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;&lt;: *common</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; api_hostname:&nbsp; 'http://test-api.<span style="color:#9900CC;">myawesomesite</span>.<span style="color:#9900CC;">com</span>'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twitter_app_key: 'eee'</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twitter_app_secret: 'eee'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">production:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;&lt;: *common</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; api_username: 'api_user_prod'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; api_password: 'bobprod123'</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; api_hostname: 'http://production-api.<span style="color:#9900CC;">myawesomesite</span>.<span style="color:#9900CC;">com</span>'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twitter_app_key: 'yyy'</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twitter_app_secret: 'yyy' </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The variables in the common section are applied to every environment and overridden like in the case of production, which overrides the api_username and api_password. In each environment they pull the company_name from the common block. </p>
<p>To use a value in your rails app, use the APP_CONFIG array, like<br />
APP_CONFIG['website_name'] or APP_CONFIG['twitter_app_key'] and it will always return the value for the environment currently in Rails.env </p>
<p>Thanks to my friend Rath who showed me this, I changed the name from config to app_config because I liked it to be more specific, but use whatever name you like! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubygeek.com/2011/07/16/adding-an-application-config-file-to-a-rails-project/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Practicing Ruby with RailsCasts</title>
		<link>http://www.rubygeek.com/2011/07/10/practicing-ruby-with-railscasts/</link>
		<comments>http://www.rubygeek.com/2011/07/10/practicing-ruby-with-railscasts/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 03:13:59 +0000</pubDate>
		<dc:creator>nola</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://www.rubygeek.com/?p=196</guid>
		<description><![CDATA[I recently went on a small vacation and finally had some time to catch up on some railscasts! I like to setup a project and "play along" with Ryan Bates and pause/play and work through the examples. With all my experimentation/playing I keep a git repo at http://github.com/rubygeek/rubygeek where I keep code for reference later. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently went on a small vacation and finally had some time to catch up on some <a href="http://railscasts.com">railscasts</a>! I like to setup a project and "play along" with Ryan Bates and pause/play and work through the examples. With all my experimentation/playing I keep a git repo at http://github.com/rubygeek/rubygeek where I keep code for reference later. Sometimes when trying to remember if i did something, I grep a keyword or two on the root directory and see if I have done something with it before. I can put notes in the readme file for each project, so I can remember what resources I used.</p>
<p><a href="http://railscasts.com/episodes/264-guard">#264 Guard</a> - Setups up monitoring for files to run something like tests, compile coffee script or sass. The cast shows how to use it to run your rspec tests. It shows liverefresh, with that and a plugin it will automatically refresh your browser!</p>
<p><a href="http://railscasts.com/episodes/262-trees-with-ancestry">#262 Ancestory</a> - I spent a good deal of time using acts_as_commentable_with_threading and although its pretty good, I think now I will change to using this, it seems like it will be more efficent on queries and has more scopes defined.</p>
<p><a href="http://railscasts.com/episodes/254-pagination-with-kaminari">#254 Kaminari</a> - Wow, this is totally awesome! I did have to do some digging to figure out will_paginate for rails3, and this is way better as it is a rails engine, so its soooper easer to customize. The labels for the next/previous are stored in the language file (ie. en.yml) so if you support multiple languages, this is awesome. If you need to customize beyond  css, you can run the rake command to generate the views. </p>
<p><a href="http://railscasts.com/episodes/271-resque">#271 Resque</a> - I might need to do something like this soon for a project, so I was happy to see this. It was pretty easy to do and I like the admin interface to see what is going on. Even more cool, is it is written in sinatra and you can hang it of your rails app if you want and assign a route to it. Definitely a fun screencast to follow along with!</p>
<p><a href="http://railscasts.com/episodes/269-template-inheritance">#269 Template Inheritance</a> - Finally, this makes perfect sense. Available in Rails 3.1 you can have an Application directory in the views directory and there you can place things common to all views, like header, footer, sidebar etc ... then if you need it customized footer for say the Products page, you can put a footer partial there and that is used on product pages. Previously you had to make a directory like common, shared. etc etc and it always seemed hackish to me.</p>
<p>Recently Ryan has put before and after version of the code in his gitrepo, and though I usually try to do it all myself, I did grab his before code for the Template Inheritance.</p>
<p>Thats about all for now, give those a try and practice ruby!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubygeek.com/2011/07/10/practicing-ruby-with-railscasts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Koan-a-copia!</title>
		<link>http://www.rubygeek.com/2011/01/22/koan-a-copia/</link>
		<comments>http://www.rubygeek.com/2011/01/22/koan-a-copia/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 04:04:11 +0000</pubDate>
		<dc:creator>nola</dc:creator>
				<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.rubygeek.com/?p=156</guid>
		<description><![CDATA[I first learned about Koans from EdgeCase Ruby Koans project, it was great fun and great practice. Since then, whenever I mentored a DevChix or RailsMentors member I suggest to start doing Koans... even on a regular basis, once you finish them all .. then start over! I always have a ruby koan mid-way and [...]]]></description>
			<content:encoded><![CDATA[<p>I first learned about Koans from EdgeCase Ruby Koans project, it was great fun and great practice. Since then, whenever I mentored a <a href="http://www.devchix.com">DevChix</a> or <a href="http://www.railsmentors.org/">RailsMentors</a> member I suggest to start doing Koans... even on a regular basis, once you finish them all .. then start over! I always have a ruby koan mid-way and work on it when I want to practice ruby. Sometimes I try to complete the whole file then run it. Since I've been learning Groovy this week, I looked to see if there was Groovy Koans, found those.. then i just started compiling all the languages I know of..</p>
<p><strong>Ruby</strong><br />
<a href="http://rubykoans.com">http://www.rubykoans.com</a></p>
<p><strong>Python:</strong><br />
<a href="https://github.com/gregmalcolm/python_koans">https://github.com/gregmalcolm/python_koans<br />
</a></p>
<p><strong>Groovy</strong><br />
<a href="https://github.com/cjudd/groovy_koans">https://github.com/cjudd/groovy_koans</a></p>
<p><strong>Javascript</strong><br />
<a href="https://github.com/mrdavidlaing/javascript-koans">https://github.com/mrdavidlaing/javascript-koans</a><br />
<a href="https://github.com/liammclennan/JavaScript-Koans">  https://github.com/liammclennan/JavaScript-Koans </a></p>
<p><strong>Scala</strong><br />
<a href="https://github.com/rubbish/scala-koans">https://github.com/rubbish/scala-koans</a></p>
<p><strong>Perl</strong><br />
Sadly...I was not able to find one for Perl ... </p>
<p><strong>Functional Koans</strong><br />
FSharp, clojure, haskell, python, scala<br />
<a href="https://github.com/relevance/functional-koans/branches">Functional Koans</a></p>
<p><strong>CoffeeScript</strong><br />
<a href="https://github.com/sleepyfox/coffeescript-koans">https://github.com/sleepyfox/coffeescript-koans</a></p>
<p>And while I was searching for other languages... I ran into this</p>
<p><a href="http://rosettacode.org/wiki/Main_Page">http://rosettacode.org/wiki/Main_Page</a></p>
<p>Its has sample problems done in multiple languages. Kinda fun!! (I recognize some of them as interview questions)</p>
<p>Any koans that you know about that are not in my list?<br />
Update 9/25/2011 - Added coffeescript<br />
Update 7/5/2012 - Added a second javascript</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubygeek.com/2011/01/22/koan-a-copia/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>January Potluck</title>
		<link>http://www.rubygeek.com/2011/01/22/january-potluck/</link>
		<comments>http://www.rubygeek.com/2011/01/22/january-potluck/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 18:39:17 +0000</pubDate>
		<dc:creator>nola</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://www.rubygeek.com/?p=154</guid>
		<description><![CDATA[I don't know what else to call this post, I've been doing a little bit of everything in past few months. I've changed jobs and thats taken much of my freetime to ramp up and get going on new projects. SO, I will write up a little of what I've been doing. Facebook -- Yes, [...]]]></description>
			<content:encoded><![CDATA[<p>I don't know what else to call this post, I've been doing a little bit of everything in past few months. I've changed jobs and thats taken much of my freetime to ramp up and get going on new projects. SO, I will write up a little of what I've been doing.</p>
<p>Facebook -- Yes, I worked on some facebook projects. Some were fan pages and some were applications. It was pretty interesting, I hadn't done much with facebook other than get addicted to some stupid games (Yes, cafe world, i've quit again.. for now..). Developing on facebook can have some frustrating moments, as if you are using FBML, then facebook takes liberty to rewrite things at will and not give you much information on errors. Programming in FBML can be irritating but, when using iframe in an application canvas url... its pretty cool because then you can code in the familiar word of jquery. The new stuff coming out like the social plugins/widgets is pretty handy.</p>
<p>Python -- Yes, I like to gripe about python and the sometimes functional and sometimes OOP nature of it. But.. I worked on a project where they already had apps in python and they weren't interested in supporting a rails app, I am not interested in supporting a rails app (they didn't want to use heroku) so.. python it is. And postgresql ... I had more problems with postgresql then python. We had our moments but we are good now. I just needed a lightweight framework so I used <a href="http://webpy.org/">web.py</a> which is pretty similar to Sinatra for Ruby. So, that was pretty good. I didn't find it as irritating to program in python as I thought, it didn't bother me about the intenting/whitespace at all.. and only a few times I forgot the : at the end of a block statement.</p>
<p>PHP -- I tried Zend Framework.. I did PHP for 6 years of my life, never really gave the MVC framework from Zend a fair shot. So I set out to give it a whirl, I started working through the <a href="http://framework.zend.com/manual/en/learning.quickstart.intro.html">tutorial</a> on zend .. when I got to the part where I had to do all this coding to setup the database.. I was like, ack, i can't take it. I am not going to knock it if you like it..but its not for me <img src='http://www.rubygeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Grails -- Yes, I've always thought that other frameworks that try to mimic rails FAIL. I haven't gotten too much into grails, but.. so far I haven't run screaming. Hehe. One thing I noticed.. the first time you run the app, it will go ahead and install all the plugins. No need to run something like bundler or rake gems:install ... it has meta-programming aspect because of Groovy, so I think that it might be successful where other frameworks zend, cakephp, etc don't quite cut it for me (I've always held fast to the reason that rails is so successful is because its made with Ruby).</p>
<p>Groovy -- This is the scripting language that Grails uses... it compiles to the JVM and i haven't quite got it all figured out .. but i found this <a href="https://github.com/cjudd/groovy_koans">Koans</a> to learn the language (I love <a href="http://rubykoans.com/">ruby koans</a> and go back every now and then and work through them)...I know that if I knew about groovy when I was doing java a few years ago I would have been alot happier. Java just requires so much typing, ack. <a href="http://groovy.codehaus.org/">Groovy</a> (although i think it could use a better name) might make java programming fun again...</p>
<p>Javascript -- Been doing more javascript/jquery. I'm always on the lookout for for screencasts/tutorials and I subscribed to <a href="http://www.thinkvitamin.com">ThinkVitamin</a>. They have great tutorials on css/html5/javascript and a growing section of frameworks. Its 25 a month but I think its well worth it. They have a series now about making an HTML5 game .. exciting!! I've been looking at javascript game frameworks. Keeping a collection of options in mind for when I figure out what kind of game I want to make.</p>
<p>Misc -- I finally got the <a href="http://pragprog.com/titles/btlang/seven-languages-in-seven-weeks">Seven Languages in Seven Weeks</a> by Pragmatic Programmers. When I first saw it, I squealed with delight but held off buying it till I had some time to dig in. I got it, did most of the ruby which I knew most of but it was good. Now I am working on the Scala section. I was listening to the <a href="http://javaposse.com/">Java Posse</a> podcast and heard the excitement and joy in Dicks voice, so I was intrigued to find what is scala? Once I tried it, I understood his excitement. Scala has clear syntax (like ruby) and one thing I like for learning an interactive console...the completest (or maybe its compulsive crazy person) in me is not wanting to try the others until I finished the Scala section.</p>
<p>My <3 still belongs to Ruby, but I like to try out other things from time to time...I basically strive to use the best tool for the job and sometimes that means using whatever is going to be supported (as in the case of using python for one project) or one that is already in use (the grails site I am working on) and I don't want to begrudge anyone on their choice of languages. </p>
<p>And Happy New Year!</p>
<p>Go forth and program!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubygeek.com/2011/01/22/january-potluck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting around with GNU Screen</title>
		<link>http://www.rubygeek.com/2010/07/16/getting-around-with-gnu-screen/</link>
		<comments>http://www.rubygeek.com/2010/07/16/getting-around-with-gnu-screen/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 13:25:19 +0000</pubDate>
		<dc:creator>nola</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rubygeek.com/?p=152</guid>
		<description><![CDATA[In past few months, I worked on a project developed entirely on linux. Previously, I mostly did rails development on mac with textmate. I had a brief period of rails and perl where I did vim and screen...oh maybe 4 years ago. Anyways, so I didn't forget much vim over the years, but I had [...]]]></description>
			<content:encoded><![CDATA[<p>In past few months, I worked on a project developed entirely on linux. Previously, I mostly did rails development on mac with textmate. I had a brief period of rails and perl where I did vim and screen...oh maybe 4 years ago. Anyways, so I didn't forget much vim over the years, but I had forgotten how to use screen. I looked some documentation to refresh my memory and this post is mainly notes for me <img src='http://www.rubygeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Most commands start with CTRL-a<br />
I refer to each spawning of a new screen in the current session as a window.</p>
<p><strong>Detach</strong><br />
One things i really like about screen is I can detach it on one computer... then log in somewhere else and reattach. Also handy when you are on a wifi card on the train and you get disconnected. (doh!)</p>
<p>ctrl-a d   to detach<br />
then start  with -r  to reattach: screen -r</p>
<p><strong>Create window</strong><br />
This creates a new terminal window</p>
<p>ctrl-a c</p>
<p><strong>Name that window</strong><br />
Name your window, so its easier to keep organized<br />
ctrl-a A (Yep, ctrl-a then SHIFT-a)</p>
<p><strong>List the windows</strong><br />
See a list of your sessions and their number (this is why you name them) and you can use arrows to select)<br />
ctrl-a "</p>
<p><strong>Navigating Windows</strong><br />
You can flip through the windows in order or specify the number:<br />
ctrl-a p previous window<br />
ctrl-a n, ctrl-a [spacebar]  next window<br />
ctrl-a # the number you want to go to (starts at 0). </p>
<p><strong>multiple regions in one</strong><br />
ctrl-a S   create a split, creates a new region<br />
ctrl-a TAB switch to next region<br />
ctrl-a c   create a terminal session in region<br />
ctrl-a X close the region<br />
ctrl-a C clear, this is like typing clear at the prompt to clear the screen</p>
<p><strong>Closing</strong><br />
To exit a window, simply type exit. To exit and kill all windows do<br />
ctrl-a ctrl-\</p>
<p><strong>Scrolling</strong><br />
Using terminal on mac or linux won't capture the scroll back.... so you must do it through screen<br />
ctrl-a [    use the arrow key to navigate up </p>
<p><strong>Refresh</strong><br />
ctrl-a l  refresh the current display</p>
<p><strong>HELP!!</strong><br />
To see the two (!!) pages of screen commands type:<br />
ctrl-a ? </p>
<p><strong>Command mode</strong><br />
Do you like typing?<br />
ctrl-a :   to get to command mode, then you can type commands instead of the ctrl foo jibberish</p>
<p><strong>Need the time?</strong><br />
ctrl-a t   ....displays the current system time</p>
<p><strong>Named Screen Sessions</strong><br />
Maybe you are working on two separate projects at once, give each one its own screen session<br />
screen -S ProjectOne<br />
screen -S ProjectTwo<br />
screen -list </p>
<p>then later you can do<br />
screen -r ProjectOne</p>
<p>to reattach it and continue</p>
<p>One thing you can do it make it easier is to add this to your .screenrc<br />
<code><br />
hardstatus alwayslastline "%?%{yk}%-Lw%?%{wb}%n*%f %t%?(%u)%?%?%{yk}%+Lw%?"<br />
</code></p>
<p>It will show the names of the windows you have and highlight the current one. You can see the numbers too so you can do ctrl-a # quickly to jump around.</p>
<p>Anyways, hope this was useful to someone. Let me know any suggestions or anything I can do better!</p>
<p>Sources:</p>
<ul>
<li><a href="http://hriday.org/blog/?page_id=595">Unix Screen</a>
<li>Screen Man Page
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.rubygeek.com/2010/07/16/getting-around-with-gnu-screen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby-Debug</title>
		<link>http://www.rubygeek.com/2010/06/22/ruby-debug/</link>
		<comments>http://www.rubygeek.com/2010/06/22/ruby-debug/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 18:04:19 +0000</pubDate>
		<dc:creator>nola</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.rubygeek.com/?p=151</guid>
		<description><![CDATA[I never really used a debugger until I did Java. Before that I did what was called "PHP Debugging" which is littering your code with print statements until you figure out what you need to know, then going back and making sure you deleted them! I sometimes would put a unique string like print "QWE" [...]]]></description>
			<content:encoded><![CDATA[<p>I never really used a debugger until I did Java. Before that I did what was called "PHP Debugging" which is littering your code with print statements until you figure out what you need to know, then going back and making sure you deleted them! I sometimes would put a unique string like </p>
<p>print "QWE" . $myawesomevar </p>
<p>Or something like that, then going back and searching your code for QWE (just picked something that was easy to type!). But all that gets rather annoying. They might have nice debuggers for PHP now, I haven't really done php in 4-5 years. I really didn't understand the power of breakpoints until I did java and I thought that was pretty cool. Now that I do all ruby, I sort of miss eclipse (I didn't actually think I'd ever say that...) since all I use right now is textmate and vi which don't have the built debugger support that eclipse does. Some of the newer ruby editors might, I haven't spent any research on them.</p>
<p>I found ruby-debug and it works great! You can set a breakpoint and then climb inside your application and peek around and see what is going on. I've done this in controllers and even in test mode. </p>
<p>If you use passenger, you can still use it but its a little tricky to setup. This <a href="http://duckpunching.com/passenger-mod_rails-for-development-now-with-debugger">blog post</a> from duckpunching.com  has some neat tips and a rake task to make it easier. Be sure to start the rdebug -c  from the console after you have set a breakpoint and reloaded your page.</p>
<p>If you are using passenger, you can't use the irb command inside of the ruby-debug console, but I found that most of the time just being able to poke around the variable space inside my app has been enough for me to understand what is going on.</p>
<p>There are quite a few commands available in the debug console, but these are the ones I've used:</p>
<p>help - view the list of commands<br />
l list  -  this shows context around the current line the debugger is on<br />
n next - moves to the next line<br />
p print - print a variable<br />
irb  jump to console - I dont use this very often and it doesn't work if you are using passenger<br />
c cont - continue to end of breakpoint or end of page load, after I have seen what I want to see I do this to get out of the console</p>
<p>Resources</p>
<ul>
<li><a href="http://railscasts.com/episodes/54-debugging-with-ruby-debug">Railscasts Episode: Debugging with ruby-debug</a></li>
<li><a href="http://duckpunching.com/passenger-mod_rails-for-development-now-with-debugger">Duckpunching.com how to use ruby-debug with passenger</a></li>
</ul>
<p>Anyways, hope some of you find it useful and happy debugging <img src='http://www.rubygeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Update: I wrote this in preparation for a short talk at <a href="http://austinonrails.org">AustinOnRails</a> while giving the talk, the group had some suggestions:</p>
<p>put in a ~/.rdebugrc</p>
<pre>
set autoeval
set autolist
</pre>
<p>autolist - will run list command when you enter<br />
autoeval - will eval each line, so instead of "eval @profile" to get it to print, it will automatically eval</p>
<p>doing  m [object] can show methods in a nice table format. Thats cool, i have often gone to irb and did String.methods.sort but that is kinda hard to read. </p>
<p>Anyways, good stuff! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubygeek.com/2010/06/22/ruby-debug/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Texas Javascript Conference</title>
		<link>http://www.rubygeek.com/2010/06/06/texas-javascript-conference/</link>
		<comments>http://www.rubygeek.com/2010/06/06/texas-javascript-conference/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 17:11:18 +0000</pubDate>
		<dc:creator>nola</dc:creator>
				<category><![CDATA[Javascript/AJAX]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.rubygeek.com/?p=150</guid>
		<description><![CDATA[Yesterday I went to the Texas Javascript conference! Its was held in Austin, TX. I had bought the ticket probably about 3 months ago. In part, I wanted to learn more javascript and I wanted to check out Austin. Now, through a series of events, I have moved to Austin from Chicago recently. I really [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I went to the <a href="http://texasjavascript.com">Texas Javascript conference</a>! Its was held in Austin, TX. I had bought the ticket probably about 3 months ago. In part, I wanted to learn more javascript and I wanted to check out Austin. Now, through a series of events, I have moved to Austin from Chicago recently.  I really like the smaller local conferences, I've really liked attending Windy City Rails in Chicago and the YAPC (Perl) when we had it in Chicago.</p>
<p>There were 2 tracks of speakers and one track of impromptu talks/discussions in a third room. It was sometimes hard to choose, but here's what I attended:</p>
<p><strong>Douglas Crockford: Really, JavaScript?</strong><br />
I really liked this talk, he spoke very frank about the language and highlighted the good parts and bad parts. ECMAScript5 was passed and he said most people working on the language have never used it. He went over parts of the language explaining what is new. He said "Mashups are the most interesting thing in decades, taking components and wiring them together for the benefit of the user" ..which he followed with "A Mashup is a self inflicting XSS attack." XSS attacks were first invented in 1995 and we have made no progress in 14 yrs to solve it. He talked about HTML5, stating that its a big step in the wrong direction. Its not correcting the problem. He recommends scrapping it and starting over, its terrible for security. It increased the attack surface and gives attackers new modes of attack, such as access to local database and inter-process communication. His final slide was "IE6 MUST DIE" in huge letters. Several people including myself  <a href="http://http://twitpic.com/1u642z">snapped a photo</a>. He said IE6 won't die because we keep supporting it and coding around its flaws. He doesn't think its unreasonable to ask people to update their software once a decade! So this talk was very informative and had some funny parts.</p>
<p><strong>John Resig: JavaScript on the Mobile Web</strong><br />
I expected this to be more of how to make your javascript run on mobile phones, but it was an overview of all the platforms that are used and which ones have what browsers. He graded all the phones and their browsers with A, B or C scale. Some have very good emulators but some things are hard to test in an emulator, like interactions with the touch screen. That was pretty interesting...and now I know I need to spend about 5k to have all the phones I need to test on <img src='http://www.rubygeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p><strong>Joe McCann: Rapid Prototyping with JavaScript</strong><br />
I watched this for about 25 mins, wasn't sure its usefulness to me. So I went to Dan Webs talk.</p>
<p><strong>Dan Webb: Building @anywhere: A Client-side Interface to Twitter</strong><br />
I walked in as he was talking about how twitter does communication when you give a site access to your login. It was pretty interesting. I wish I had seen all of this talk.</p>
<p><strong>Paul Irish: 10 Things I Learned from the jQuery Source</strong><br />
I debated between going to "Eugene Lazutkin: Dojo for Programmers" because I think I know more about jQuery than Dojo, but since I don't plan on doing Dojo at work, I decided to check out Paul Irish. I really like him on the <a href="http://yayquery.com/">yayQuery Podcast</a> and his blogs. He gave a great presentation and it was my favorite of the day! He basically talked about javascript and looked up things in the jQuery source and explained what the javascript was doing. He was pretty funny and I really enjoyed it. I tried taking notes, but it was pretty fascinating to watch him code. </p>
<p><strong>Alex Sexton: Breaking The Cross Domain Barrier</strong><br />
Another person from the <a href="http://yayquery.com/">yayQuery Podcast</a>. He talked about different ways to get around the cross domain barrier. It was interesting, many things are new since I last did alot of javascript where I needed to load from another domain. He was pretty funny too.</p>
<p><strong>Tom Hughes-Croucher: JavaScript Everywhere! Creating a 100% JavaScript web stack</strong><br />
I meant to go to this talk, but was in the hall talking to a guy from Facebook, swapping stories of working for Facebook vs Google and how I use facebook. I also talked to <a href="http://saucelabs.com/about/team">Jason Huggins</a> a bit, creator of Selenium. I knew him from Chicago and we chatted about what was going on in Chicago and caught up a bit... and talked about testing. We share some of the same opinions and it was great to catch up. </p>
<p><strong>Jason Huggins: JavaScript Frameworks &#038; Functional Testing</strong><br />
This Jason leading a discussion with the creators of jQuery, Dojo and extJS talking about how we can standardize a way to test. It was pretty interesting, but they ran out of time. </p>
<p><strong>JavaScript   	Tim Caswell: Writing a real-time game with NodeJS</strong><br />
I have looked at nodejs  few times but never tried it. Now, I am going to have to try it. The speaker was very good and it was interesting.</p>
<p><strong>Kyle Simpson: Web Performance &#038; UI Architecture</strong><br />
I didn't find this too interesting nor the other talk, so I basically talked to a few people in the lobby and headed home. Long day but I learned some cool stuff. <img src='http://www.rubygeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, a great conference and made some new friends and saw some old ones! <img src='http://www.rubygeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubygeek.com/2010/06/06/texas-javascript-conference/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
