<?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>paul schreiber &#187; web</title>
	<atom:link href="http://paulschreiber.com/blog/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://paulschreiber.com</link>
	<description>tagline goes here</description>
	<lastBuildDate>Wed, 18 Jan 2012 04:06:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>TurboVote at Harvard and Personal Democracy Forum</title>
		<link>http://paulschreiber.com/blog/2011/06/07/turbovote-harvard-pdf/</link>
		<comments>http://paulschreiber.com/blog/2011/06/07/turbovote-harvard-pdf/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 15:53:14 +0000</pubDate>
		<dc:creator>paulschreiber</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://paulschreiber.com/?p=2165</guid>
		<description><![CDATA[On May 24, Seth Flaxman and I told the story of TurboVote Berkman Center for Internet &#38; Society: Yesterday, we talked TurboVote at Personal Democracy Forum:]]></description>
			<content:encoded><![CDATA[<p>On May 24, Seth Flaxman and I told the story of TurboVote <a href="http://cyber.law.harvard.edu/">Berkman Center for Internet &amp; Society</a>:</p>
<p><embed src="http://wilkins.law.harvard.edu/events/luncheons/2011-05-24_turbovote/2011-05-24_turbovote640.mov" width="640" height="496" /></p>
<p>Yesterday, we talked TurboVote at Personal Democracy Forum:</p>
<p><iframe width="640" height="385" src="http://cdn.livestream.com/embed/pdf2011?layout=4&#038;clip=pla_aa63ff33-941f-4a5a-9f2d-4428575a82ba&#038;color=0xe7e7e7&#038;autoPlay=false&#038;mute=false&#038;iconColorOver=0x888888&#038;iconColor=0x777777&#038;allowchat=true" style="border:0;outline:0" frameborder="0" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://paulschreiber.com/blog/2011/06/07/turbovote-harvard-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://wilkins.law.harvard.edu/events/luncheons/2011-05-24_turbovote/2011-05-24_turbovote640.mov" length="545470544" type="video/quicktime" />
		</item>
		<item>
		<title>How to solve Facebook&#8217;s error 1366027</title>
		<link>http://paulschreiber.com/blog/2011/05/05/how-to-solve-facebooks-error-1366027/</link>
		<comments>http://paulschreiber.com/blog/2011/05/05/how-to-solve-facebooks-error-1366027/#comments</comments>
		<pubDate>Thu, 05 May 2011 14:00:38 +0000</pubDate>
		<dc:creator>paulschreiber</dc:creator>
				<category><![CDATA[broken]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://paulschreiber.com/?p=2126</guid>
		<description><![CDATA[Sometimes, Facebook silently fails when you upload a new profile picture. After clicking Upload Picture, message indicating &#8220;your changes have been saved&#8221; is displayed. However, the new picture does not appear on your profile. Further, the string success=0&#38;errornum=1366027 is appended &#8230; <a href="http://paulschreiber.com/blog/2011/05/05/how-to-solve-facebooks-error-1366027/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes, Facebook silently fails when you upload a new profile picture. </p>
<p>After clicking Upload Picture, message indicating &#8220;your changes have been saved&#8221; is displayed. However, the new picture does not appear on your profile. Further, the string <code>success=0&amp;errornum=1366027</code> is appended to the URL.</p>
<p>This error means the image you uploaded is too small. You need to use one that is at least 190px wide.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulschreiber.com/blog/2011/05/05/how-to-solve-facebooks-error-1366027/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How not to get iPhone users to switch to BlackBerry</title>
		<link>http://paulschreiber.com/blog/2011/05/04/how-not-to-get-iphone-users-to-switch-to-blackberry/</link>
		<comments>http://paulschreiber.com/blog/2011/05/04/how-not-to-get-iphone-users-to-switch-to-blackberry/#comments</comments>
		<pubDate>Wed, 04 May 2011 23:50:37 +0000</pubDate>
		<dc:creator>paulschreiber</dc:creator>
				<category><![CDATA[broken]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://paulschreiber.com/?p=2122</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a class="inline" href="http://paulschreiber.com/wp-content/uploads/2011/05/BlackBerry-app-world-windows-only.png"><img src="http://paulschreiber.com/wp-content/uploads/2011/05/BlackBerry-app-world-windows-only-1024x774.png" alt="" title="BlackBerry app world windows only" width="640" height="483" class="alignnone size-large wp-image-2123" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://paulschreiber.com/blog/2011/05/04/how-not-to-get-iphone-users-to-switch-to-blackberry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO count words in JavaScript</title>
		<link>http://paulschreiber.com/blog/2011/03/03/howto-count-words-in-javascript/</link>
		<comments>http://paulschreiber.com/blog/2011/03/03/howto-count-words-in-javascript/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 22:36:57 +0000</pubDate>
		<dc:creator>paulschreiber</dc:creator>
				<category><![CDATA[public service announcement]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://paulschreiber.com/?p=2086</guid>
		<description><![CDATA[Here is a handy JavaScript function for counting words: String.prototype.countWords = function(value) { // remove html tags var cleanedText = this.replace(/< .[^]*?>/g, ' ') // remove numbers and punctuation .replace(/[–—.(),;:!?%#$‘’“”'"_+=\/\-]*/g, '') // remove/coalesce space chars .replace(/(&#38;nbsp;&#124;&#38;#160;&#124;[ ])+/gi, ' '); // &#8230; <a href="http://paulschreiber.com/blog/2011/03/03/howto-count-words-in-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here is a handy JavaScript function for counting words:</p>
<blockquote class="code">String.prototype.countWords = function(value) {
  // remove html tags
  var cleanedText = this.replace(/< .[^<>]*?>/g, ' ')
  // remove numbers and punctuation
  .replace(/[–—.(),;:!?%#$‘’“”'"_+=\/\-]*/g, '')
  // remove/coalesce space chars
  .replace(/(&amp;nbsp;|&amp;#160;|[ ])+/gi, ' ');
  // don't split "" into words, as you'll get 1 ([""])
  if (cleanedText === "") { return 0; }
  // count words
  return cleanedText.split(/\W/).length;
}</blockquote>]]></content:encoded>
			<wfw:commentRss>http://paulschreiber.com/blog/2011/03/03/howto-count-words-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Only if I have an equation editor</title>
		<link>http://paulschreiber.com/blog/2011/02/15/only-if-i-have-an-equation-editor/</link>
		<comments>http://paulschreiber.com/blog/2011/02/15/only-if-i-have-an-equation-editor/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 16:17:39 +0000</pubDate>
		<dc:creator>paulschreiber</dc:creator>
				<category><![CDATA[broken]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://paulschreiber.com/?p=2050</guid>
		<description><![CDATA[I&#8217;m supposed to sign up for your site how?]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m supposed to sign up for your site <em>how</em>?<br />
<img src="http://paulschreiber.com/wp-content/uploads/2011/02/image.jpeg" alt="" title="Evil CAPTCHA" width="300" height="57" class="alignnone size-full wp-image-2051" /></p>
]]></content:encoded>
			<wfw:commentRss>http://paulschreiber.com/blog/2011/02/15/only-if-i-have-an-equation-editor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HOWTO setup multistage deployment with Capistrano</title>
		<link>http://paulschreiber.com/blog/2011/02/12/howto-setup-multistage-deployment-with-capistrano/</link>
		<comments>http://paulschreiber.com/blog/2011/02/12/howto-setup-multistage-deployment-with-capistrano/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 01:24:29 +0000</pubDate>
		<dc:creator>paulschreiber</dc:creator>
				<category><![CDATA[public service announcement]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[multistage]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[staging]]></category>
		<guid isPermaLink="false">http://paulschreiber.com/?p=2013</guid>
		<description><![CDATA[When I wrote about deploying PHP sites with Capistrano, step 6 was a bit of a throwaway — hey, here's a quick hack for handling multistage deployment. I'd been using variants of that technique for quite some time but figured &#8230; <a href="http://paulschreiber.com/blog/2011/02/12/howto-setup-multistage-deployment-with-capistrano/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I wrote about <a href="http://paulschreiber.com/blog/2009/03/15/howto-deploy-php-sites-with-capistrano-2/">deploying PHP sites with Capistrano</a>, step 6 was a bit of a throwaway — hey, here's a quick hack for handling multistage deployment. I'd been using variants of that technique for quite some time but figured there must be a better way. There is: <a href="http://weblog.jamisbuck.org/2007/7/23/capistrano-multistage">Capistrano multistage</a>. There is even <a href="https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension">documentation</a> for this. But it misses a few steps.</p>
<h3>How to setup multistage deployment with Capistrano</h3>
<ol>
<li>Install capistrano and capistrano multistage</li>
<li>Capify your project</li>
<li>Set up the <code>deploy/</code> directory</li>
<li>Create the deployment recipes</li>
</ol>
<p>In my Rails-based example, we'll have two stages: <em>staging</em> and <em>production</em>. You can name your stages whatever you want. However, don’t name one of your stages <em>stage</em> — that's a reserved word. Call it <em>staging</em>.</p>
<h3>Install capistrano and capistrano multistage</h3>
<p><code>gem install capistrano
<br />gem install capistrano-ext</code></p>
<h3>Capify your project</h3>
<p><code>capify .</code></p>
<h3>Set up the <code>deploy</code> directory</h3>
<p><code>
mkdir config/deploy
<br />touch config/deploy/staging.rb
<br />touch config/deploy/production.rb
</code>
</p>
<h3>Create the deployment recipes</h3>
<p>You’re going to edit three files: <code>deploy.rb</code>, <code>staging.rb</code> and <code>production.rb</code>:</p>
<h4>deploy.rb</h4>
<blockquote class="code">set :stages, %w(staging production)
set :default_stage, "production"
require 'capistrano/ext/multistage'
<br />default_run_options[:pty] = true
<br />set :application, "myproject"
set :use_sudo, false
set :keep_releases, 5
<br />set :repository,  "https://somewhere/svn/myproject/trunk"
set :scm, :subversion
set :scm_username, "me"
set :deploy_via, :export
<br /># this is useful in a shared hosting environment, where you have your own JAVA_HOME or GEM_HOME.
# otherwise, just set RAILS_ENV
set(:rake) { "JAVA_HOME=#{java_home} GEM_HOME=#{gem_home} RAILS_ENV=#{rails_env} /usr/bin/env rake" }
<br /># since :domain is defined in another file (staging.rb and production.rb),
# we need to delay its assignment until they're loaded
set(:domain) { "#{domain}" }
role(:web) { domain }
role(:app) { domain }
role(:db, :primary => true) { domain }
<br />namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end
end
<br /># for some reason, this isn't enabled by default
after "deploy:update", "deploy:cleanup"
<br /># here is an example task which uses rake, as defined above
after "deploy:migrate", "load_sample_fixtures"
desc "load sample fixtures"
task :load_sample_fixtures do
  run "cd #{current_release}; FIXTURES=samples #{rake} db:fixtures:load"
end
</blockquote>
<h4>staging.rb</h4>
<blockquote class="code">set :deploy_to, "/path/to/#{application}-stage"
# My Rails app uses RJB, so it needs to know where Java lives
set :java_home, "/path/to/java-6-openjdk"
set :domain, "testing.myserver.ca"
set :user, "paul"
set :rails_env, "staging"
# I am root on my staging server and have all the right gems installed
# so I don't need GEM_HOME to be overridden
set :gem_home, nil
</blockquote>
<h4>production.rb</h4>
<blockquote class="code">set :deploy_to, "/home/myuser/#{application}"
set :java_home, "/home/myuser/sw/jdk"
set :domain, "www.myserver.ca"
set :user, "myuser"
set :rails_env, "production"
set :gem_home, "/home/myuser/ruby/gems/"
<br /># in a shared hosting environment, you often need to specify your own passenger configuration
desc "copy the .htaccess file (passenger configuration); setup_load_paths.rb (sets GEM_HOME)"
namespace :deploy do
  task :copy_htaccess do
    run "cp #{current_release}/config/htaccess_production #{current_release}/public/.htaccess"
    run "mv #{current_release}/config/production_setup_load_paths.rb #{current_release}/config/setup_load_paths.rb"
  end
end
<br />after "deploy:update_code", "deploy:copy_htaccess"
</blockquote>
<p>Now, you’re set. You can deploy with <code>cap deploy</code> (for the default stage, production), or <code>cap staging deploy</code>. <a href="http://macromates.com/">TextMate</a>'s Capistrano plugin handles this gracefully, presenting you with a dialog listing the available stages.</p>]]></content:encoded>
			<wfw:commentRss>http://paulschreiber.com/blog/2011/02/12/howto-setup-multistage-deployment-with-capistrano/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to display tweets on a WordPress page</title>
		<link>http://paulschreiber.com/blog/2011/02/11/how-to-display-tweets-on-a-wordpress-page/</link>
		<comments>http://paulschreiber.com/blog/2011/02/11/how-to-display-tweets-on-a-wordpress-page/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 23:34:33 +0000</pubDate>
		<dc:creator>paulschreiber</dc:creator>
				<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://paulschreiber.com/?p=2002</guid>
		<description><![CDATA[There are a lot of ways to display your tweets on your blog. Many are complicated and ugly. Sometimes, you hit Twitter&#8217;s API rate limit. Most require the client to perform additional work. I made a very simple WordPress plugin &#8230; <a href="http://paulschreiber.com/blog/2011/02/11/how-to-display-tweets-on-a-wordpress-page/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are a lot of ways to display your tweets on your blog. Many are complicated and ugly. Sometimes, you hit Twitter&#8217;s API rate limit. Most require the client to perform additional work. I made a very simple WordPress plugin to handle this.</p>
<p>All you do is stick <code>&#91;get_latest_tweets username="me"&#93;</code> where you want the tweets to go. You can optionally supply a <code>count=X</code> parameter to display more or fewer tweets.</p>
<p>JSON is cached, preventing the Twitter server from being hit more than twice in one minute.</p>
<p>You get markup like this, which you can style as you please:</p>
<blockquote><p><code>&lt;ul class=&#x27;tweets&#x27;&gt;<br />
&lt;li&gt;@&lt;a class=&#x27;atreply&#x27; href=&#x27;http://twitter.com/jane&#x27;&gt;jane&lt;/a&gt; Please dance a jig. &lt;span class=&#x27;date&#x27;&gt;&lt;a href=&#x27;http://twitter.com/me/status/2345&#x27;&gt;3 hours ago&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;<br />
&lt;li&gt;Anyone used TotalFinder? &lt;a href=&#x27;http://t.co/blah&#x27;&gt;http://t.co/blah&lt;/a&gt; Saw it on @&lt;a class=&#x27;atreply&#x27; href=&#x27;http://twitter.com/bob&#x27;&gt;bob&lt;/a&gt;&#x27;s machine and am intrigued. &lt;span class=&#x27;date&#x27;&gt;&lt;a href=&#x27;http://twitter.com/me/status/1234&#x27;&gt;6 hours ago&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
</code></p></blockquote>
<p>Grab <a href="https://github.com/paulschreiber/get_latest_tweets">the plugin</a> from GitHub or <a href="http://wordpress.org/extend/plugins/get-latest-tweets/">the WordPress plugin directory.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://paulschreiber.com/blog/2011/02/11/how-to-display-tweets-on-a-wordpress-page/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to display the latest blog post on a WordPress page</title>
		<link>http://paulschreiber.com/blog/2011/02/04/how-to-display-the-latest-blog-post-on-a-wordpress-page/</link>
		<comments>http://paulschreiber.com/blog/2011/02/04/how-to-display-the-latest-blog-post-on-a-wordpress-page/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 06:13:57 +0000</pubDate>
		<dc:creator>paulschreiber</dc:creator>
				<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://paulschreiber.com/?p=1985</guid>
		<description><![CDATA[There are a lot of ways to display the latest blog post. They&#8217;re all complicated and ugly. I made a very simple WordPress plugin to handle this. It has no settings or options. All you do is stick &#91;get_latest_post&#93; where &#8230; <a href="http://paulschreiber.com/blog/2011/02/04/how-to-display-the-latest-blog-post-on-a-wordpress-page/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are a lot of ways to display the latest blog post. They&#8217;re all complicated and ugly. I made a very simple WordPress plugin to handle this. It has no settings or options.</p>
<p>All you do is stick <code>&#91;get_latest_post&#93;</code> where you want the post to go.</p>
<p>You get markup like this, which you can style as you please:</p>
<blockquote><p><code>&lt;div class='latest-post'&gt;<br />
&lt;p class=&#x27;title&#x27;&gt;&lt;a href=&#x27;http://www.mysite.ca/blog/post&#x27;&gt;Look ma, no hands!&lt;/a&gt;&lt;/p&gt;<br />
&lt;p class=&#x27;excerpt&#x27;&gt;Today I rode a bicycle &amp;hellip; &lt;a href=&quot;http://www.mysite.ca/blog/post&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;rarr;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;<br />
&lt;/div&gt;<br />
</code></p></blockquote>
<p>Grab <a href="https://github.com/paulschreiber/get_latest_post">the plugin</a> from GitHub or <a href="http://wordpress.org/extend/plugins/get-latest-post/">the WordPress plugin directory</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulschreiber.com/blog/2011/02/04/how-to-display-the-latest-blog-post-on-a-wordpress-page/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Eric Schmidt at DLD</title>
		<link>http://paulschreiber.com/blog/2011/01/30/eric-schmidt-at-dld/</link>
		<comments>http://paulschreiber.com/blog/2011/01/30/eric-schmidt-at-dld/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 06:41:56 +0000</pubDate>
		<dc:creator>paulschreiber</dc:creator>
				<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://paulschreiber.com/?p=1891</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/-IGfBGHDHRc" frameborder="0" allowFullScreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://paulschreiber.com/blog/2011/01/30/eric-schmidt-at-dld/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Via Rail&#8217;s broken newsletter signup</title>
		<link>http://paulschreiber.com/blog/2011/01/05/via-rails-broken-newsletter-signup/</link>
		<comments>http://paulschreiber.com/blog/2011/01/05/via-rails-broken-newsletter-signup/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 21:05:35 +0000</pubDate>
		<dc:creator>paulschreiber</dc:creator>
				<category><![CDATA[broken]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://paulschreiber.com/?p=1874</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://paulschreiber.com/wp-content/uploads/2011/01/via.png" alt="" title="via" width="875" height="620" class="alignnone size-full wp-image-1875" /></p>
]]></content:encoded>
			<wfw:commentRss>http://paulschreiber.com/blog/2011/01/05/via-rails-broken-newsletter-signup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

