<?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>Martin Ström &#187; ruby</title>
	<atom:link href="http://my-domain.se/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://my-domain.se</link>
	<description></description>
	<lastBuildDate>Wed, 11 Jan 2012 11:04:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>InstaCRT</title>
		<link>http://my-domain.se/instacrt/</link>
		<comments>http://my-domain.se/instacrt/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 08:05:00 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[crt]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://my-domain.se/?p=487</guid>
		<description><![CDATA[This project started as an idea to see how a &#8220;real world&#8221; filter for photos (like the popular Histamatic and Instagram apps) would work, except our filter is actually real and not digitally applied. When I joined the project, Ruben Broman and Erik Wåhlström were more or less already done connecting all the hardware and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://my-domain.se/wordpress/wp-content/uploads/2011/11/capture-2011-09-22_15-02-54_7039.jpg" alt="" title="" width="640" height="510" class="aligncenter size-full wp-image-517"></p>

<p>This project started as an idea to see how a &#8220;real world&#8221; filter for photos (like the popular Histamatic and Instagram apps) would work, except our filter is actually real and not digitally applied.</p>

<p>When I joined the project, <a href="http://rubenbroman.se">Ruben Broman</a> and <a href="http://erikwahlstrom.se">Erik Wåhlström</a> were more or less already done connecting all the hardware and had the screen working as a regular external screen connected to his old laptop. The same night I hacked together a funny looking Ruby script that fetched images from a ftp server, downloaded them and showed them in fullscren on the old CRT display while a Canon 7D took the photo. We managed to get it up and running the same night and even had time to throw together a quick iPhone application that uploads the photos to the ftp server. 
This early version of the project used the Ruby script, Image Capture (built into OS X) and QuickTime 7 to display the photo in fullscreen on the little display. The day after I added a Tumblr uploader so the photos get published on <a href="http://instacrt.tumblr.com/">the blog</a>.</p>

<p><img src="http://my-domain.se/wordpress/wp-content/uploads/2011/11/photo_2011-09-23_12-57-43-3127.jpg" alt="" title="photo_2011-09-23_12-57-43-3127" width="640" height="510" class="aligncenter size-full wp-image-518" /></p>

<p>This worked but was very instable so all code was rewritten within the first week it was up and running, mostly for stability but also seperated into different smaller scripts to they could run asyncronysly. We replaced QuickTime with a Quartz Composer project that allowed images to be displayed in fullscreen while not beeing the forground application, and replaced Image Capture with the command line tool GPhoto. Everything was still controlled by Ruby scripts but, as written above, seperated into three smaller classes/files so they could work in parallel, with a main deamon file using <strong>Forever</strong> The ftp server was replaced with a smarter REST based server to handle the uploading, downloading and archiving of the images. </p>

<p>The iPhone app was also rewritten from scratch to be cleaner and smarter. As of today, about 30 people have the beta (distributed using awesome <a href="http://testflightapp.com">Testflight</a>).</p>

<p>Except for some smaller tweaks, the current version of the project has been up and running for about a month without restart nor crash so I would say it&#8217;s pretty stable now. We haven&#8217;t really decided exactly what to do with the project right now. We might release the app to the public and keep it going for as long as it&#8217;s possible, or just see InstaCRT as a fun hack.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Haxxor night</title>
		<link>http://my-domain.se/haxxor-night/</link>
		<comments>http://my-domain.se/haxxor-night/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 16:22:18 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[dyi]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://my-domain.se/?p=472</guid>
		<description><![CDATA[I&#8217;m building a pretty cool little project with Ruben right now. More info soon here!]]></description>
			<content:encoded><![CDATA[<p><img src="http://my-domain.se/wordpress/wp-content/uploads/2011/06/Unknown.jpeg" alt="" title="" width="720" height="540" class="alignnone size-full wp-image-484" /></p>

<p>I&#8217;m building a pretty cool little project with <a href="http://rubenbroman.se">Ruben</a> right now. More info <del>soon</del> <add><a href="/instacrt">here</a>!</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TwitterFax</title>
		<link>http://my-domain.se/twitterfax/</link>
		<comments>http://my-domain.se/twitterfax/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 08:01:40 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://my-domain.se/?p=369</guid>
		<description><![CDATA[The TwitterFax is a small project done together with Konst &#38; Teknik. It will watch a given Twitter username for mentions and then print it, together with any twitpics or yimg images attached to it. The code is pretty simple and uses the Twitter gem for communicating with Twitter and Prawn to genereate the PDF&#8217;s. [...]]]></description>
			<content:encoded><![CDATA[<div><img src="http://twitpic.com/show/large/1ng4hj"></div>

<p>The TwitterFax is a small project done together with <a href="http://konst-teknik.se">Konst &amp; Teknik</a>. It will watch a given Twitter username for mentions and then print it, together with any twitpics or yimg images attached to it. </p>

<p>The code is pretty simple and uses the <a href="http://rubygems.org/gems/twitter">Twitter gem</a> for communicating with Twitter and <a href="http://rubygems.org/gems/prawn">Prawn</a> to genereate the PDF&#8217;s. I&#8217;ve set it up to run every 15 minute using a Cron job. </p>

<p><a href="http://github.com/haraldmartin/TwitterFax/blob/master/twitterfax.rb">Check out the full source code.</a> You&#8217;ll need to change what typeface to use or get <code>LucidFaxEFRom.ttf</code> from somewhere else.</p>

<p>So go ahead and <a href="http://twitter.com/home/?status=@konst_teknik">mention @konst_teknik</a> to try it out!</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Push notifications for Things Touch (iPhone/iOS) using Prowl</title>
		<link>http://my-domain.se/push-notifications-for-things-touch-iphone-ios/</link>
		<comments>http://my-domain.se/push-notifications-for-things-touch-iphone-ios/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 09:25:36 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[prowl]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[things]]></category>
		<category><![CDATA[things-rb]]></category>

		<guid isPermaLink="false">http://my-domain.se/?p=387</guid>
		<description><![CDATA[While waiting for Things Touch to officially support push notifications I hacked my own solution based on Prowl and my own Ruby library for Things, things-rb. Installation I&#8217;ve setup Dropbox to share my Things database betweeen my laptop and a computer at home which is always online. Buy and install Prowl on your iOS device. [...]]]></description>
			<content:encoded><![CDATA[<p>While waiting for <a href="http://culturedcode.com/things/iphone/">Things Touch</a> to officially support push notifications I hacked my own solution based on <a href="http://prowl.weks.net/">Prowl</a> and my own Ruby library for Things, <a href="http://github.com/haraldmartin/things-rb">things-rb</a>.</p>

<h2>Installation</h2>

<ol>
<li><p>I&#8217;ve setup <a href="https://www.dropbox.com/referrals/NTI3MjE1OQ">Dropbox</a> to share my Things database betweeen my laptop and a computer at home which is always online.</p></li>
<li><p>Buy and install <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=320876271">Prowl</a> on your iOS device.</p></li>
<li><p>On the home computer/server, install things-rb:</p>

<p><code>$ (sudo) gem update --system # if you're on an older RubyGems version</code><br />
<code>$ (sudo) gem install things-rb</code></p></li>
<li><p>..and the prowl gem to talk to the Prowl API</p>

<p><code>$ (sudo) gem install prowl</code></p></li>
<li><p>Save this file somewhere (like <code>~/bin/prowl_things.rb</code>)</p>

<script src="http://gist.github.com/458424.js"></script></li>
<li><p>Setup a cronjob to run the script as often as you&#8217;d like. Mine runs every weekday at 8:45 am.</p>

<p><code>45     8      *       *      1-5     /usr/bin/ruby /Users/me/bin/prowl_things.rb</code></p></li>
</ol>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download torrent files from Twitter DMs</title>
		<link>http://my-domain.se/download-torrent-files-from-twitter-dms/</link>
		<comments>http://my-domain.se/download-torrent-files-from-twitter-dms/#comments</comments>
		<pubDate>Mon, 24 May 2010 06:10:30 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://my-domain.se/?p=356</guid>
		<description><![CDATA[Here&#8217;s a simple ruby script to download torrent files in Safari sent to you/an account as URLs in Twitter direct messages. It could be used on your home server to download torrent files you send to it from something like your iPad. I&#8217;ve set it up to run every fifth minute (using cron) to check [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple ruby script to download torrent files in Safari sent to you/an account as URLs in Twitter direct messages. </p>

<p>It could be used on your home server to download torrent files you send to it from something like your iPad.</p>

<script src="http://gist.github.com/396688.js"></script>

<p>I&#8217;ve set it up to run every fifth minute (using cron) to check for new files, but can of course be adjusted to something that works for you.</p>

<p>Also, make sure to point Safari&#8217;s download folder (in Safari&#8217;s preferences) to the same folder as you have Transmission automatically watch for <code>.torrent</code> files so the download actually starts.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paperclip processor to turn images into grayscale</title>
		<link>http://my-domain.se/paperclip-grayscale-processor/</link>
		<comments>http://my-domain.se/paperclip-grayscale-processor/#comments</comments>
		<pubDate>Mon, 17 May 2010 06:10:37 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://my-domain.se/?p=360</guid>
		<description><![CDATA[We wanted to automatically create a grayscale version of the uploaded images for a current project. Here&#8217;s the Paperclip processor we&#8217;re using:]]></description>
			<content:encoded><![CDATA[<p>We wanted to automatically create a grayscale version of the uploaded images for a current project. Here&#8217;s the <a href="http://github.com/thoughtbot/paperclip">Paperclip</a> processor we&#8217;re using:</p>

<script src="http://gist.github.com/397144.js"></script>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>nordea-rb</title>
		<link>http://my-domain.se/nordea-rb-ruby-library-to-access-nordea-bank-accounts/</link>
		<comments>http://my-domain.se/nordea-rb-ruby-library-to-access-nordea-bank-accounts/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 15:31:38 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://burnfield.com/martin/?p=227</guid>
		<description><![CDATA[Last week I hacked together a small little project/library called nordea-rb. It&#8217;s a Ruby library and a (pretty basic right now) command line tool for getting read-only access to Nordea Bank accounts. I use it for displaying my accounts&#8217; balances so I can see when invoices are paid etc. Everything you need to know is [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I hacked together a small little project/library called <a href="http://github.com/haraldmartin/nordea-rb">nordea-rb</a>. It&#8217;s a Ruby library and a (pretty basic right now) command line tool for getting read-only access to Nordea Bank accounts.  I use it for displaying my accounts&#8217; balances so I can see when invoices are paid etc.</p>

<p>Everything you need to know is in the <a href="http://github.com/haraldmartin/nordea-rb">README on GitHub</a> so if you&#8217;re interested in this, check it out.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>things-rb—command line tool and Ruby library for Things.app</title>
		<link>http://my-domain.se/things-rb-command-line-tool-and-ruby-library-for-thingsapp/</link>
		<comments>http://my-domain.se/things-rb-command-line-tool-and-ruby-library-for-thingsapp/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 18:47:54 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[things-rb]]></category>
		<category><![CDATA[things.app]]></category>

		<guid isPermaLink="false">http://burnfield.com/martin/?p=204</guid>
		<description><![CDATA[I wanted to display my ToDos from Things on the Desktop using GeekTool so I created a command line tool in Ruby (backed by a library) to access the database. This way you can see what needs to be done but without switching (or even launching Things) It&#8217;s in a pretty early state right now [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://img.skitch.com/20090323-xacfsghrsi7p6yjt1x2fnse8ek.jpg" alt="Things + GeekTool" /></p>

<p>I wanted to display my ToDos from <a href="http://culturedcode.com/things/">Things</a> on the Desktop using <a href="http://projects.tynsoe.org/en/geektool/">GeekTool</a> so I created a command line tool in Ruby (backed by a library) to access the database.</p>

<p>This way you can see what needs to be done but without switching (or even launching Things)</p>

<p>It&#8217;s in a pretty early state right now and probably has bugs but I&#8217;ve been using it for some days now without problems.
I&#8217;m planning to add write-support as well (so you can create tasks from the command line if Things isn&#8217;t running) but right now it&#8217;s read-only.</p>

<p>For more information, check out the <a href="http://github.com/haraldmartin/things-rb">README file and source on GitHub</a> or <a href="http://culturedcode.com/things/forums/read.php?3,23671">this thread</a> on the Things&#8217; forum</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>./script/server with automatic port finder</title>
		<link>http://my-domain.se/scriptserver-with-automatic-port-finder/</link>
		<comments>http://my-domain.se/scriptserver-with-automatic-port-finder/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 21:20:15 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://burnfield.com/martin/?p=116</guid>
		<description><![CDATA[This is the script I&#8217;m using when I start my local Rails development server. It will automatically detect the next available port starting at the default port 3000 so I can have multiple servers running without remembering what ports that are already busy. #!/usr/bin/env ruby DEFAULT_PORT = 3000 puts (`ps aux &#124; grep [r]uby &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>This is the script I&#8217;m using when I start my local Rails development server. It will automatically detect the next available port starting at the default port 3000 so I can have multiple servers running without remembering what ports that are already busy.</p>

<pre><code>#!/usr/bin/env ruby

DEFAULT_PORT = 3000

puts (`ps aux | grep [r]uby | grep script/server`.split("\n").map { |l|
  server = l.split(/\s+/)[11..-1]
  (port = server.index('-p')) ? server[port.next].to_i : DEFAULT_PORT
}.max || DEFAULT_PORT - 1).next
</code></pre>

<p>I aliased it to <code>ss</code> in <code>.bash_profile</code> like this:</p>

<pre><code>alias ss='./script/server -p `~/bin/available_rails_port`'
</code></pre>

<p>(Btw, Happy 2008! I haven&#8217;t updated this site for a while)</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Modernize Rails (or: get rid of Verdana)</title>
		<link>http://my-domain.se/modernize-rails-or-get-rid-of-verdana/</link>
		<comments>http://my-domain.se/modernize-rails-or-get-rid-of-verdana/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 10:29:55 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsplugin]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://burnfield.com/martin/2007/12/29/modernize-rails-or-get-rid-of-verdana/</guid>
		<description><![CDATA[Tired of see the the soooo 1999-ish font &#8220;Verdana&#8221; every time you get a local error page in Rails? Now you don&#8217;t have to. With this plugin the error pages will use Arial or Helvetica instead—finally! To install: ./script/plugin install http://burnfield.com/svn/martin/rails/plugins/verdano or as svn:external: ./script/plugin install -x http://burnfield.com/svn/martin/rails/plugins/verdano I&#8217;ve moved to git so the new [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://my-domain.se/wordpress/wp-content/uploads/verdano.png' alt='Verdano'></p>

<p>Tired of see the the soooo 1999-ish font &#8220;Verdana&#8221; every time you get a local error page in Rails? <br />
Now you don&#8217;t have to. With this plugin the error pages will use Arial or Helvetica instead—finally!</p>

<div class="del" markdown="0">
<del>To install:
<pre><code>./script/plugin install http://burnfield.com/svn/martin/rails/plugins/verdano</code></pre>
<p>or as svn:external:</p>
<pre><code>./script/plugin install -x http://burnfield.com/svn/martin/rails/plugins/verdano</code></pre>
</del>
</div>

<div class="add">
  <p>I&#8217;ve moved to git so the new instructions are: </p>
  <pre><code>git clone git://github.com/haraldmartin/verdano.git</code></pre>
  <p>or just <a href="http://evil.che.lu/projects/braid">braid it</a></p>
</div>

<p>Happy new year!</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

