<?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>Jay, trying to remember...</title>
	<atom:link href="http://jaywiggins.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jaywiggins.com</link>
	<description>Code, Music, Food, Fun and Whatnot...</description>
	<lastBuildDate>Thu, 16 Jun 2011 07:04:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>C99 Mode &#8211; Whatever that is&#8230;</title>
		<link>http://jaywiggins.com/2011/06/c99-mode-whatever-that-is/</link>
		<comments>http://jaywiggins.com/2011/06/c99-mode-whatever-that-is/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 06:56:40 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[attiny]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[avr-gcc]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[c99]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[makefile]]></category>

		<guid isPermaLink="false">http://jaywiggins.com/?p=64</guid>
		<description><![CDATA[So, I&#8217;ve never dabbled in C until now while using it with AVR microcontrollers &#8211; and while trying to complie a simple for loop: for &#40;uint8_t bit = 0x80; bit; bit &#62;&#62;= 1&#41; &#123; ... &#125; I got this error: error: 'for' loop initial declaration used outside C99 mode and to fix it I would [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve never dabbled in C until now while using it with AVR microcontrollers &#8211; and while trying to complie a simple for loop:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">uint8_t</span> bit <span style="color: #339933;">=</span> <span style="color: #208080;">0x80</span><span style="color: #339933;">;</span> bit<span style="color: #339933;">;</span> bit <span style="color: #339933;">&gt;&gt;=</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    ...
  <span style="color: #009900;">&#125;</span></pre></div></div>

<p>I got this error:</p>
<pre>error: 'for' loop initial declaration used outside C99 mode</pre>
<p>and to fix it I would move my decloration of the varabile outside of the loop. This seemed stupid to me so a quick Google search turned up <a href="http://cplusplus.syntaxerrors.info/index.php?title='for'_loop_initial_declaration_used_outside_C99_mode">this</a></p>
<blockquote><p>Back in the old days, when dinosaurs roamed the earth and programmers used punch cards, you were not allowed to declare variables anywhere except at the very beginning of a block.</p></blockquote>
<p>Solution was to add <code>-std=c99</code> to the Makefile. My new AVR Makefile now looks like this..</p>
<p><script src="https://gist.github.com/1028804.js?file=gistfile1.mak"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://jaywiggins.com/2011/06/c99-mode-whatever-that-is/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8-Bit Sine Wave Table</title>
		<link>http://jaywiggins.com/2011/05/8-bit-sine-wave-table/</link>
		<comments>http://jaywiggins.com/2011/05/8-bit-sine-wave-table/#comments</comments>
		<pubDate>Wed, 11 May 2011 04:03:30 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[attiny]]></category>
		<category><![CDATA[attiny85]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[rainbow]]></category>
		<category><![CDATA[rgb]]></category>
		<category><![CDATA[sin]]></category>
		<category><![CDATA[sine]]></category>
		<category><![CDATA[sine wave]]></category>

		<guid isPermaLink="false">http://jaywiggins.com/?p=63</guid>
		<description><![CDATA[This was what I needed for a rainbow RGB LED cycle&#8230;]]></description>
			<content:encoded><![CDATA[<p>This was what I needed for a rainbow RGB LED cycle&#8230;</p>
<p><script src="https://gist.github.com/965900.js?file=sine.c"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://jaywiggins.com/2011/05/8-bit-sine-wave-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ATtiny software PWM to drive RGB LED</title>
		<link>http://jaywiggins.com/2011/05/attiny-software-pwm-to-drive-rgb-led/</link>
		<comments>http://jaywiggins.com/2011/05/attiny-software-pwm-to-drive-rgb-led/#comments</comments>
		<pubDate>Wed, 04 May 2011 07:24:38 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[atmel]]></category>
		<category><![CDATA[attiny]]></category>
		<category><![CDATA[attiny85]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[pulse width]]></category>
		<category><![CDATA[pwm]]></category>
		<category><![CDATA[rgb]]></category>

		<guid isPermaLink="false">http://jaywiggins.com/?p=61</guid>
		<description><![CDATA[Based on Atmel&#8217;s AVR136: Low-Jitter Multi-Channel Software PWM Application note, here&#8217;s a 3 channel software-based pulse width modulator to drive a RGB LED. This is a proof of concept and currently there is some in-efficient color cycling code in there, but the goal is to drive these cheap chips using an I2C (two wire serial) [...]]]></description>
			<content:encoded><![CDATA[<p>Based on Atmel&#8217;s <a href='http://www.atmel.com/dyn/resources/prod_documents/doc8020.pdf'>AVR136: Low-Jitter Multi-Channel Software PWM</a> Application note, here&#8217;s a 3 channel software-based pulse width modulator to drive a RGB LED. This is a proof of concept and currently there is some in-efficient color cycling code in there, but the goal is to drive these cheap chips using an I2C (two wire serial) bus. Disco dance floor anyone?&#8230;</p>
<p><script src="https://gist.github.com/954874.js?file=main.c"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://jaywiggins.com/2011/05/attiny-software-pwm-to-drive-rgb-led/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AVR Dragon / avrdude command to reset bad ATtiny85 fuses</title>
		<link>http://jaywiggins.com/2011/05/avr-dragon-avrdude-command-to-reset-bad-attiny85-fuses/</link>
		<comments>http://jaywiggins.com/2011/05/avr-dragon-avrdude-command-to-reset-bad-attiny85-fuses/#comments</comments>
		<pubDate>Wed, 04 May 2011 06:57:33 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[atmel]]></category>
		<category><![CDATA[attiny]]></category>
		<category><![CDATA[avr dragon]]></category>
		<category><![CDATA[avrdude]]></category>
		<category><![CDATA[dragon_hvsp]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[high voltage]]></category>
		<category><![CDATA[reset]]></category>

		<guid isPermaLink="false">http://jaywiggins.com/?p=60</guid>
		<description><![CDATA[avrdude -c dragon_hvsp -p attiny85 -U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -P usb]]></description>
			<content:encoded><![CDATA[<pre>
avrdude -c dragon_hvsp -p attiny85 -U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -P usb
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jaywiggins.com/2011/05/avr-dragon-avrdude-command-to-reset-bad-attiny85-fuses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AVR ATTiny85 Makefile</title>
		<link>http://jaywiggins.com/2011/04/avr-attiny85-makefile/</link>
		<comments>http://jaywiggins.com/2011/04/avr-attiny85-makefile/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 03:55:39 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[attiny]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[makefile]]></category>
		<category><![CDATA[usbtiny]]></category>

		<guid isPermaLink="false">http://jaywiggins.com/?p=59</guid>
		<description><![CDATA[This is what I&#8217;m using as a Makefile &#8211; based on what was included in a downloaded XCode template project &#8211; Can&#8217;t remember where I downloaded the starting point, but thanks&#8230;]]></description>
			<content:encoded><![CDATA[<p>This is what I&#8217;m using as a Makefile &#8211; based on what was included in a downloaded XCode template project &#8211; Can&#8217;t remember where I downloaded the starting point, but thanks&#8230;</p>
<p><script src="https://gist.github.com/943607.js?file=Makefile"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://jaywiggins.com/2011/04/avr-attiny85-makefile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino / AVR ATTiny</title>
		<link>http://jaywiggins.com/2011/04/arduino-avr-attiny/</link>
		<comments>http://jaywiggins.com/2011/04/arduino-avr-attiny/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 17:50:21 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[attiny]]></category>
		<category><![CDATA[avr]]></category>

		<guid isPermaLink="false">http://jaywiggins.com/?p=57</guid>
		<description><![CDATA[Starting to play around with Arduino and straight-up AVR ATTiny microprocessors&#8230; Here are some resources I&#8217;ve found helpful so far: Getting started with the ATTiny MP Building and using an AVR target board]]></description>
			<content:encoded><![CDATA[<p>Starting to play around with Arduino and straight-up AVR ATTiny microprocessors&#8230; Here are some resources I&#8217;ve found helpful so far:</p>
<ol>
<li><a href='http://metku.net/index.html?path=articles/microcontroller-part-1/index_eng'>Getting started with the ATTiny MP</a></li>
<li><a href='http://www.evilmadscientist.com/article.php/avrtargetboards'>Building and using an AVR target board</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://jaywiggins.com/2011/04/arduino-avr-attiny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing up your DB on a Capistrano deployment</title>
		<link>http://jaywiggins.com/2010/05/backing-up-your-db-on-a-capistrano-deployment/</link>
		<comments>http://jaywiggins.com/2010/05/backing-up-your-db-on-a-capistrano-deployment/#comments</comments>
		<pubDate>Thu, 20 May 2010 14:22:01 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://jaywiggins.com/?p=55</guid>
		<description><![CDATA[Yeah, it&#8217;s simple but useful. Since I&#8217;m using sqlite at the moment, it&#8217;s just a copy but you could run any command in a similar way. I&#8217;m also tagging the backup name with a date. Here&#8217;s a snip from my Capistrano deploy file&#8230;. # ...snip... namespace :deploy do task :restart do t=Time.now run &#34;cp /path/to/db.sqlite3 [...]]]></description>
			<content:encoded><![CDATA[<p>Yeah, it&#8217;s simple but useful. Since I&#8217;m using <code>sqlite</code> at the moment, it&#8217;s just a copy but you could run any command in a similar way. I&#8217;m also tagging the backup name with a date. Here&#8217;s a snip from my Capistrano deploy file&#8230;.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># ...snip...</span>
namespace <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  task <span style="color:#ff3333; font-weight:bold;">:restart</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    t=<span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>
    run <span style="color:#996600;">&quot;cp /path/to/db.sqlite3 /path/to/backup/#{t.year}-#{t.month}-#{t.day}_#{t.hour}:#{t.min}:#{t.sec}_db.sqlite3&quot;</span>
    run <span style="color:#996600;">&quot;touch #{current_path}/tmp/restart.txt&quot;</span> 
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://jaywiggins.com/2010/05/backing-up-your-db-on-a-capistrano-deployment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook OAuth with Sinatra</title>
		<link>http://jaywiggins.com/2010/05/facebook-oauth-with-sinatra/</link>
		<comments>http://jaywiggins.com/2010/05/facebook-oauth-with-sinatra/#comments</comments>
		<pubDate>Thu, 20 May 2010 13:43:12 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[access token]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[client id]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[graph.facebook.com]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[oauth]]></category>

		<guid isPermaLink="false">http://jaywiggins.com/?p=53</guid>
		<description><![CDATA[This MOSTLY is working, so, here&#8217;s what I found when trying to connect to Facebook with OAuth. It needs some serious refactoring because a lot of this was done in an &#8220;investigative&#8221; trial and error way. It also looks like Facebook have improved their docs on this since I was first looking at them&#8230; First, [...]]]></description>
			<content:encoded><![CDATA[<p>This <strong>MOSTLY</strong> is working, so, here&#8217;s what I found when trying to connect to Facebook with OAuth. It needs some <strong>serious refactoring</strong> because a lot of this was done in an &#8220;investigative&#8221; trial and error way. It also looks like Facebook have improved their <a href='http://developers.facebook.com/docs/api'>docs on this</a> since I was first looking at them&#8230;</p>
<p>First, you need to initiate a connection:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">    get <span style="color:#996600;">'/:blog_name/facebook/oauth/create'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      redirect <span style="color:#996600;">&quot;https://graph.facebook.com/oauth/authorize?client_id=##FACEBOOK API KEY##&amp;redirect_uri=##CALLBACK URL##&amp;scope=publish_stream,user_status,user_photos,user_about_me&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>where <code>##FACEBOOK API KEY##</code> = your applications API key (mine is a 32 digit hex value) and <code>##CALLBACK URL##</code> = the URL that will be processing the next step. Also, the scope value let&#8217;s you get more access to the user&#8217;s account. Check their <a href='http://developers.facebook.com/docs/authentication/permissions'>extended permissions</a> doc for more info.</p>
<p>Next, you need to process what comes back from Facebook. I am stashing what comes back in the DB (the <code> FacebookOauthToken</code> model). Also using the <code>Mechanize</code> gem which is pretty silly. Some of the code below is specific to my app, so ignore those bits&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">    get <span style="color:#996600;">'/:blog_name/facebook/oauth/callback'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      <span style="color:#9966CC; font-weight:bold;">if</span> !params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'code'</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">blank</span>?
        url=<span style="color:#996600;">&quot;https://graph.facebook.com/oauth/access_token&quot;</span>
        client_id=<span style="color:#996600;">&quot;client_id=##CLIENT ID##&quot;</span>
        client_secret=<span style="color:#996600;">&quot;client_secret=## CLIENT SECRET ##&quot;</span>
        code=<span style="color:#996600;">&quot;code=#{URI.escape(params['code'])}&quot;</span>
        redirect_uri=<span style="color:#996600;">&quot;redirect_uri=http://example.org/#{@blog.url_name}/facebook/oauth/callback&quot;</span>
&nbsp;
        url=<span style="color:#996600;">&quot;#{url}?#{client_id}&amp;#{client_secret}&amp;#{code}&amp;#{redirect_uri}&quot;</span>
        <span style="color:#9966CC; font-weight:bold;">begin</span>
          res=<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>url<span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#9966CC; font-weight:bold;">rescue</span>
          flash<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:error</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#996600;">&quot;There was a problem connecting to Facebook&quot;</span>
          redirect <span style="color:#996600;">&quot;/#{@blog.url_name}/&quot;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
        read=res.<span style="color:#9900CC;">read</span>
        access_token=<span style="color:#CC00FF; font-weight:bold;">CGI</span>.<span style="color:#9900CC;">parse</span><span style="color:#006600; font-weight:bold;">&#40;</span>read<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'access_token'</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        <span style="color:#9966CC; font-weight:bold;">if</span> !access_token.<span style="color:#9900CC;">blank</span>?
          <span style="color:#0066ff; font-weight:bold;">@blog</span>.<span style="color:#9900CC;">facebook_oauth_token</span> = FacebookOauthToken.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:access_token</span><span style="color:#006600; font-weight:bold;">=&gt;</span>access_token,:blog_name<span style="color:#006600; font-weight:bold;">=&gt;</span>params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:blog_name</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
          <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@blog</span>.<span style="color:#9900CC;">save</span>
            <span style="color:#9966CC; font-weight:bold;">begin</span>
              a=Mechanize.<span style="color:#9900CC;">new</span>
              res=a.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;https://graph.facebook.com/me/?access_token=#{access_token}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
              <span style="color:#0066ff; font-weight:bold;">@blog</span>.<span style="color:#9900CC;">facebook_oauth_token</span>.<span style="color:#9900CC;">facebook_id</span>=JSON<span style="color:#006600; font-weight:bold;">&#40;</span>res.<span style="color:#9900CC;">body</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'id'</span><span style="color:#006600; font-weight:bold;">&#93;</span>
              <span style="color:#0066ff; font-weight:bold;">@blog</span>.<span style="color:#9900CC;">save</span>!
            <span style="color:#9966CC; font-weight:bold;">rescue</span>
              flash<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:error</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#996600;">&quot;There was a problem getting information from Facebook&quot;</span>
              redirect <span style="color:#996600;">&quot;/#{@blog.url_name}/&quot;</span>
            <span style="color:#9966CC; font-weight:bold;">end</span>
            flash<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:notice</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#996600;">&quot;Facebook connection created!&quot;</span>
            redirect <span style="color:#996600;">&quot;/#{@blog.url_name}/&quot;</span>
          <span style="color:#9966CC; font-weight:bold;">else</span>
            flash<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:error</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#996600;">&quot;There was a problem saving Facebook connection&quot;</span>
            redirect <span style="color:#996600;">&quot;/#{@blog.url_name}/&quot;</span>
          <span style="color:#9966CC; font-weight:bold;">end</span>
        <span style="color:#9966CC; font-weight:bold;">else</span>
          flash<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:error</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#996600;">&quot;There was a problem making Facebook connection&quot;</span>
          redirect <span style="color:#996600;">&quot;/#{@blog.url_name}/&quot;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#9966CC; font-weight:bold;">else</span>
        flash<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:error</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#996600;">&quot;There was a problem connecting to Facebook&quot;</span>
        redirect <span style="color:#996600;">&quot;/#{@blog.url_name}/&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Where <code>##CLIENT ID##</code> = your <strong>Application ID</strong> (mine is a 12 digit numeric value) and <code>## CLIENT SECRET ##</code> = your <strong>Application Secret</strong> (mine is a 32 digit hex value).</p>
<p>Once you have an <code>access_token</code> you should be able to make calls to URLs like this: <code><br />
"https://graph.facebook.com/me/?access_token=#{access_token}"</code>. The <code>/me</code> path is the connected user&#8217;s data and I&#8217;m grabbing their Facebook ID from the returned JSON for use elsewhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaywiggins.com/2010/05/facebook-oauth-with-sinatra/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Been neglecting this blog &#8217;cause I&#8217;ve been busy.</title>
		<link>http://jaywiggins.com/2010/05/been-neglecting-this-blog-cause-ive-been-busy/</link>
		<comments>http://jaywiggins.com/2010/05/been-neglecting-this-blog-cause-ive-been-busy/#comments</comments>
		<pubDate>Thu, 20 May 2010 13:19:21 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jaywiggins.com/?p=52</guid>
		<description><![CDATA[Going to start reviewing what went down with my little app though.]]></description>
			<content:encoded><![CDATA[<p>Going to start reviewing what went down with my little app though.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaywiggins.com/2010/05/been-neglecting-this-blog-cause-ive-been-busy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capistrano deploy to multiple locations</title>
		<link>http://jaywiggins.com/2010/04/capistrano-deploy-to-multiple-locations/</link>
		<comments>http://jaywiggins.com/2010/04/capistrano-deploy-to-multiple-locations/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 22:34:22 +0000</pubDate>
		<dc:creator>jay</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[recipe]]></category>
		<category><![CDATA[stage]]></category>

		<guid isPermaLink="false">http://jaywiggins.com/?p=50</guid>
		<description><![CDATA[Pretty simple, but wanted to log here so I can look this up in the future&#8230; I wanted to deploy to both a stage and a live site. Here&#8217;s how that went down: First I installed the capistrano-ext gem. Second, I edited my Capfile to look like this: 1 2 3 require 'capistrano/ext/multistage' set :default_stage, [...]]]></description>
			<content:encoded><![CDATA[<p>Pretty simple, but wanted to log here so I can look this up in the future&#8230;</p>
<p>I wanted to deploy to both a stage and a live site. Here&#8217;s how that went down:</p>
<p>First I installed the <code>capistrano-ext</code> gem. Second, I edited my Capfile to look like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'capistrano/ext/multistage'</span>
set <span style="color:#ff3333; font-weight:bold;">:default_stage</span>, <span style="color:#996600;">&quot;beta&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:stages</span>, <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>beta live<span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>Third, I created a <code>deploy</code> folder and added my two recipes there. <code>beta.rb</code> looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'deploy'</span> <span style="color:#9966CC; font-weight:bold;">if</span> respond_to?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:namespace</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;"># cap2 differentiator</span>
&nbsp;
default_run_options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:pty</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># be sure to change these</span>
set <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#996600;">'username'</span>
set <span style="color:#ff3333; font-weight:bold;">:domain</span>, <span style="color:#996600;">'beta.example.org'</span>
set <span style="color:#ff3333; font-weight:bold;">:application</span>, <span style="color:#996600;">'fundastache'</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># the rest should be good</span>
set <span style="color:#ff3333; font-weight:bold;">:repository</span>,  <span style="color:#996600;">&quot;#{user}@#{domain}:git/#{application}.git&quot;</span> 
<span style="color:#008000; font-style:italic;">#set :repository,  &quot;/home/#{user}/git/#{application}.git&quot; </span>
set <span style="color:#ff3333; font-weight:bold;">:deploy_to</span>, <span style="color:#996600;">&quot;/home/#{user}/#{domain}&quot;</span> 
set <span style="color:#ff3333; font-weight:bold;">:deploy_via</span>, <span style="color:#ff3333; font-weight:bold;">:remote_cache</span>
set <span style="color:#ff3333; font-weight:bold;">:scm</span>, <span style="color:#996600;">'git'</span>
set <span style="color:#ff3333; font-weight:bold;">:branch</span>, <span style="color:#996600;">'master'</span>
set <span style="color:#ff3333; font-weight:bold;">:git_shallow_clone</span>, <span style="color:#006666;">1</span>
set <span style="color:#ff3333; font-weight:bold;">:scm_verbose</span>, <span style="color:#0000FF; font-weight:bold;">true</span>
set <span style="color:#ff3333; font-weight:bold;">:use_sudo</span>, <span style="color:#0000FF; font-weight:bold;">false</span>
&nbsp;
server domain, <span style="color:#ff3333; font-weight:bold;">:app</span>, <span style="color:#ff3333; font-weight:bold;">:web</span>
&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  task <span style="color:#ff3333; font-weight:bold;">:restart</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    run <span style="color:#996600;">&quot;touch #{current_path}/tmp/restart.txt&quot;</span> 
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>The live recipe looks almost identical. </p>
<p>Now when I</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">cap live deploy</pre></td></tr></table></div>

<p>the site is deployed to the live environment and when I</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">cap beta deploy</pre></td></tr></table></div>

<p>or simply</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">cap deploy</pre></td></tr></table></div>

<p>the site is deployed to the beta site.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaywiggins.com/2010/04/capistrano-deploy-to-multiple-locations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

