<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7316372100242971647</id><updated>2012-02-16T09:52:25.829-08:00</updated><category term='Ubuntu'/><category term='Git'/><category term='Ruby'/><category term='Linux'/><title type='text'>Hidden Gems</title><subtitle type='html'>The Appoxy Developers Journal</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://developers.appoxy.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-4448143311256095736</id><published>2011-11-04T22:59:00.000-07:00</published><updated>2011-11-04T22:59:54.305-07:00</updated><title type='text'>How to Fix Ruby 1.9.3 "It seems your ruby installation is missing psych" Error</title><content type='html'>&lt;br /&gt;If you see this:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;/usr/local/lib/ruby/1.9.1/yaml.rb:56:in `&amp;lt;top (required)&amp;gt;':&lt;br /&gt;It seems your ruby installation is missing psych (for YAML output).&lt;br /&gt;To eliminate this warning, please install libyaml and reinstall your ruby.&lt;br /&gt;Latest version currently installed. Aborting.&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First do this:&amp;nbsp;&lt;/div&gt;&lt;blockquote class="tr_bq"&gt;sudo apt-get install libyaml-dev&lt;/blockquote&gt;&lt;div&gt;Then &lt;a href="http://developers.appoxy.com/2010/08/installing-ruby-19-from-source-on.html"&gt;rebuild/reinstall your Ruby&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-4448143311256095736?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/4448143311256095736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2011/11/how-to-fix-ruby-193-it-seems-your-ruby.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/4448143311256095736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/4448143311256095736'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2011/11/how-to-fix-ruby-193-it-seems-your-ruby.html' title='How to Fix Ruby 1.9.3 &quot;It seems your ruby installation is missing psych&quot; Error'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-6063475200382307016</id><published>2011-02-18T15:28:00.000-08:00</published><updated>2011-02-18T15:28:22.719-08:00</updated><title type='text'>Getting Current EC2 Instance Id in Ruby</title><content type='html'>&lt;script src="https://gist.github.com/834596.js?file=instance_id.rb"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-6063475200382307016?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/6063475200382307016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2011/02/getting-current-ec2-instance-id-in-ruby.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/6063475200382307016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/6063475200382307016'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2011/02/getting-current-ec2-instance-id-in-ruby.html' title='Getting Current EC2 Instance Id in Ruby'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-8593538986449509428</id><published>2011-01-17T18:22:00.000-08:00</published><updated>2011-01-17T18:22:07.719-08:00</updated><title type='text'>How to Strip All Non-Alphanumeric Characters from a String in Ruby</title><content type='html'>x.gsub(/[^[:alnum:]]/, '')&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-8593538986449509428?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/8593538986449509428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2011/01/how-to-strip-all-non-alphanumeric.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/8593538986449509428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/8593538986449509428'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2011/01/how-to-strip-all-non-alphanumeric.html' title='How to Strip All Non-Alphanumeric Characters from a String in Ruby'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-6933363341354723716</id><published>2010-08-18T18:01:00.000-07:00</published><updated>2011-11-04T22:55:05.977-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Installing Ruby 1.9 from Source on Ubuntu in Five Minutes</title><content type='html'>This is on a clean &lt;a href="http://uec-images.ubuntu.com/releases/10.04/release/"&gt;Ubuntu Lucid Lynx image&lt;/a&gt;.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;sudo apt-get install gcc libzlib-ruby libssl-dev libxslt-dev libxml2-dev&amp;nbsp;libmemcached-dev libsasl2-dev libmemcached-dbg &amp;nbsp;libpq-dev libcurl4-gnutls-dev libyaml-dev make&lt;/li&gt;&lt;li&gt;wget LINK_TO_RUBY_TAR&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Find tar link here:&amp;nbsp;&lt;a href="http://www.ruby-lang.org/en/downloads/"&gt;http://www.ruby-lang.org/en/downloads/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;tar -zxvf rubyXXXX.tar.gz&lt;/li&gt;&lt;li&gt;cd rubyXXXX&lt;/li&gt;&lt;li&gt;./configure&lt;/li&gt;&lt;li&gt;make&lt;/li&gt;&lt;li&gt;sudo make install&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;That's it, try running "ruby -v" to see the ruby version.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I recommend doing the following to enable SSL support (only takes a few seconds):&lt;/div&gt;&lt;ul&gt;&lt;li&gt;cd ext/openssl&lt;/li&gt;&lt;li&gt;ruby extconf.rb&lt;/li&gt;&lt;li&gt;make&lt;/li&gt;&lt;li&gt;sudo make install&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;And lastly, update the gem system:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;sudo gem update --system&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-6933363341354723716?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/6933363341354723716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2010/08/installing-ruby-19-from-source-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/6933363341354723716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/6933363341354723716'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2010/08/installing-ruby-19-from-source-on.html' title='Installing Ruby 1.9 from Source on Ubuntu in Five Minutes'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-1861107926854486979</id><published>2010-07-21T18:55:00.000-07:00</published><updated>2010-07-21T18:55:40.916-07:00</updated><title type='text'>Git For Noobs - The first few commands you must know to start working on a git project</title><content type='html'>This is the minimum set of things you need to know to contribute to a git repository.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium; font-weight: normal;"&gt;&lt;/span&gt;git clone&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is the first thing you need to do to get the code. Find the git repository URL and then clone it, for example:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;git clone&amp;nbsp;&lt;a href="http://github.com/appoxy/simple_record"&gt;http://github.com/appoxy/simple_record&lt;/a&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now you have the code and can start working on it. When you're done with your modifications and tested them, you then need to commit.&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;git commit&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;This will commit to your &lt;b&gt;local&lt;/b&gt;&amp;nbsp;repository, the keyword being local. And by local, I mean your hard drive, NOT the remote repository that you cloned above. This is different than subversion where a commit will commit to the remote repository.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;code&gt;&lt;br /&gt;git commit -am "I just modified some stuff... I'm not a noob anymore!"&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;Now that's committed to your &lt;b&gt;local&lt;/b&gt;&amp;nbsp;repo. Let's get that commit onto the remote repo.&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;git push&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;This will take your local commits that you made with git commit and push them up to the remote git repository that you cloned above.&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;code&gt;&lt;br /&gt;git push&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Now your changes are on the remote repository for all to see.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-1861107926854486979?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/1861107926854486979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2010/07/git-for-noobs-first-few-commands-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/1861107926854486979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/1861107926854486979'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2010/07/git-for-noobs-first-few-commands-you.html' title='Git For Noobs - The first few commands you must know to start working on a git project'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-2442922064054790762</id><published>2010-06-08T18:30:00.000-07:00</published><updated>2010-06-08T18:30:00.358-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><title type='text'>Delete a Local Git Branch</title><content type='html'>&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Use git push to the remote branch with a colon in front of the name, eg:&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;code&gt;&lt;br /&gt;git branch -D bigbadbranch&lt;/code&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-2442922064054790762?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/2442922064054790762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2010/06/delete-local-git-branch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/2442922064054790762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/2442922064054790762'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2010/06/delete-local-git-branch.html' title='Delete a Local Git Branch'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-4689792069056787400</id><published>2010-06-08T09:44:00.000-07:00</published><updated>2010-06-08T09:48:24.323-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><title type='text'>Delete a Remote Git Branch</title><content type='html'>Use git push to the remote branch with a colon in front of the name, eg:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;git push origin :nolongerneededbranch&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-4689792069056787400?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/4689792069056787400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2010/06/delete-remote-git-branch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/4689792069056787400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/4689792069056787400'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2010/06/delete-remote-git-branch.html' title='Delete a Remote Git Branch'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-5981394397556670</id><published>2010-05-11T09:44:00.000-07:00</published><updated>2010-05-11T09:44:00.901-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><title type='text'>Write a String to a File in Ruby</title><content type='html'>&lt;code&gt;&lt;br /&gt;File.open(path_to_file, 'w') {|f| f.write(content) }&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-5981394397556670?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/5981394397556670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2010/05/write-string-to-file-in-ruby.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/5981394397556670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/5981394397556670'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2010/05/write-string-to-file-in-ruby.html' title='Write a String to a File in Ruby'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-4838490922042003151</id><published>2010-05-10T10:43:00.000-07:00</published><updated>2010-05-13T10:13:21.731-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><title type='text'>Read a File into a String in Ruby</title><content type='html'>My favorite way (simplest):&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;s = IO.read(filename)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;There are other ways too:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;code&gt;&lt;br /&gt;s = File.open(filename) { |f| f.read }&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-4838490922042003151?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/4838490922042003151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2010/05/read-file-into-string-in-ruby.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/4838490922042003151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/4838490922042003151'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2010/05/read-file-into-string-in-ruby.html' title='Read a File into a String in Ruby'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-6683080326723089372</id><published>2010-05-08T10:41:00.000-07:00</published><updated>2010-05-08T10:41:39.095-07:00</updated><title type='text'>MD5 Hash of a File in Ruby</title><content type='html'>&lt;code&gt;md5 = Digest::MD5.hexdigest(File.read('path_to_file'))&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-6683080326723089372?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/6683080326723089372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2010/05/md5-hash-of-file-in-ruby.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/6683080326723089372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/6683080326723089372'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2010/05/md5-hash-of-file-in-ruby.html' title='MD5 Hash of a File in Ruby'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-987979538684230269</id><published>2010-05-06T12:49:00.000-07:00</published><updated>2010-05-06T15:34:27.936-07:00</updated><title type='text'>.nil? .blank? .present? .empty? and self</title><content type='html'>&lt;div&gt;Here is a script to check all the usages:&lt;/div&gt;&lt;code&gt;&lt;br /&gt;require 'active_support'&lt;br /&gt;&lt;br /&gt;my_stuff = [&lt;br /&gt;nil,&lt;br /&gt;true,&lt;br /&gt;false,&lt;br /&gt;"",&lt;br /&gt;"hi",&lt;br /&gt;0,&lt;br /&gt;1,&lt;br /&gt;{},&lt;br /&gt;{:something=&amp;gt;"or other"},&lt;br /&gt;[],&lt;br /&gt;["hello"]&lt;br /&gt;]&lt;br /&gt;&lt;br /&gt;my_stuff.each do |x|&lt;br /&gt;puts "x=" + x.to_s&lt;br /&gt;puts "nil? " + x.nil?.to_s&lt;br /&gt;puts "blank? " + x.blank?.to_s&lt;br /&gt;puts "present? " + x.present?.to_s&lt;br /&gt;puts "empty? " + (x.respond_to?(:empty?) ? x.empty?.to_s : "not defined")&lt;br /&gt;puts "self " + (x ? "true" : "false")&lt;br /&gt;puts ""&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;And here is the output:&lt;/div&gt;&lt;code&gt;&lt;br /&gt;x=&lt;br /&gt;nil? true&lt;br /&gt;blank? true&lt;br /&gt;present? false&lt;br /&gt;empty? not defined&lt;br /&gt;self false&lt;br /&gt;&lt;br /&gt;x=true&lt;br /&gt;nil? false&lt;br /&gt;blank? false&lt;br /&gt;present? true&lt;br /&gt;empty? not defined&lt;br /&gt;self true&lt;br /&gt;&lt;br /&gt;x=false&lt;br /&gt;nil? false&lt;br /&gt;blank? true&lt;br /&gt;present? false&lt;br /&gt;empty? not defined&lt;br /&gt;self false&lt;br /&gt;&lt;br /&gt;x=&lt;br /&gt;nil? false&lt;br /&gt;blank? true&lt;br /&gt;present? false&lt;br /&gt;empty? true&lt;br /&gt;self true&lt;br /&gt;&lt;br /&gt;x=hi&lt;br /&gt;nil? false&lt;br /&gt;blank? false&lt;br /&gt;present? true&lt;br /&gt;empty? false&lt;br /&gt;self true&lt;br /&gt;&lt;br /&gt;x=0&lt;br /&gt;nil? false&lt;br /&gt;blank? false&lt;br /&gt;present? true&lt;br /&gt;empty? not defined&lt;br /&gt;self true&lt;br /&gt;&lt;br /&gt;x=1&lt;br /&gt;nil? false&lt;br /&gt;blank? false&lt;br /&gt;present? true&lt;br /&gt;empty? not defined&lt;br /&gt;self true&lt;br /&gt;&lt;br /&gt;x={}&lt;br /&gt;nil? false&lt;br /&gt;blank? true&lt;br /&gt;present? false&lt;br /&gt;empty? true&lt;br /&gt;self true&lt;br /&gt;&lt;br /&gt;x={:something=&amp;gt;"or other"}&lt;br /&gt;nil? false&lt;br /&gt;blank? false&lt;br /&gt;present? true&lt;br /&gt;empty? false&lt;br /&gt;self true&lt;br /&gt;&lt;br /&gt;x=[]&lt;br /&gt;nil? false&lt;br /&gt;blank? true&lt;br /&gt;present? false&lt;br /&gt;empty? true&lt;br /&gt;self true&lt;br /&gt;&lt;br /&gt;x=["hello"]&lt;br /&gt;nil? false&lt;br /&gt;blank? false&lt;br /&gt;present? true&lt;br /&gt;empty? false&lt;br /&gt;self true&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-987979538684230269?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/987979538684230269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2010/05/nil-blank-present-empty-and-self.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/987979538684230269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/987979538684230269'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2010/05/nil-blank-present-empty-and-self.html' title='.nil? .blank? .present? .empty? and self'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316372100242971647.post-8068830349090502421</id><published>2010-05-06T12:17:00.000-07:00</published><updated>2010-05-06T12:17:50.331-07:00</updated><title type='text'>Blog for our Developers</title><content type='html'>This blog will feature posts from our developers about the things they are working on and tips and tricks about Ruby on Rails and Cloud insfrastructure, Amazon in particular.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316372100242971647-8068830349090502421?l=developers.appoxy.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developers.appoxy.com/feeds/8068830349090502421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://developers.appoxy.com/2010/05/blog-for-our-developers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/8068830349090502421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316372100242971647/posts/default/8068830349090502421'/><link rel='alternate' type='text/html' href='http://developers.appoxy.com/2010/05/blog-for-our-developers.html' title='Blog for our Developers'/><author><name>Travis Reeder</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-UEsYnV81w1c/AAAAAAAAAAI/AAAAAAABDIM/A4_dFCaaEE0/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
