<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Bear Den Designs - The Decider's Musings</title>
    <link>http://beardendesigns.com/blogs/feed/66-Please_Spam_This_Post?user=1</link>
    <description>Blog postings by The Decider of Bear Den Designs</description>
    <language>en-us</language>
    <atom:link type="application/rss+xml" rel="self" href="http://beardendesigns.com/blogs/feed/66-Please_Spam_This_Post?user=1"/>
    <item>
      <title>iTerm2, tmux and vim</title>
      <description>&lt;h2&gt;Switching up my development environment.&lt;/h2&gt;
&lt;p&gt;Recently I came across some posts describing tmux, a gnu/screen alternative.  I use screen quite a bit but only when doing remote system admin and really enjoy it&amp;#8217;s features.  Especially being able to attach to a session that was terminated due to connectivity problems.&lt;/p&gt;
&lt;p&gt;I had never given a second thought about using screen on my dev machine since &lt;Command-Tab&gt; is so quick to jump between apps.  However, after reading through the &lt;a href=&quot;http://robots.thoughtbot.com/post/2641409235/a-tmux-crash-course&quot;&gt;Giant Robots Post&lt;/a&gt;  I have had a re-think.  In some ways I feel as though I&amp;#8217;m stepping back 20 years but has dev really changed at all in 20 years?  Maybe some of our methodologies but not the general trend of Test-Code-Deploy-Repeat.&lt;/p&gt;
&lt;p&gt;Anyway, there are 3 tools needed to make this work on my Mac.&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;a href=&quot;http://sites.google.com/site/iterm2home/&quot;&gt;iTerm2&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://tmux.sourceforge.net/&quot;&gt;tmux&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;and the best editor in the world, &lt;a href=&quot;http://vim.org&quot;&gt;vim&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;iTerm2&lt;/h3&gt;
&lt;p&gt;Probably any terminal will do but iTerm2 is much faster at resizing than iTerm and is actively being developed.&lt;/p&gt;
&lt;h3&gt;tmux&lt;/h3&gt;
&lt;p&gt;This is a terminial multiplexor with many of the features of gnu/screen but in my opinion easier to configure.  &lt;a href=&quot;http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/&quot;&gt;Recommended Tutorial&lt;/a&gt; The port version is a bit dated so I recommend installing from source.  Follow the instructions.  It&amp;#8217;s your basic configure, make, make install.&lt;/p&gt;
&lt;h3&gt;vim&lt;/h3&gt;
&lt;p&gt;Now normally I run MacVim on my mac. It&amp;#8217;s pretty.  The console version courtesy of Apple seems just fine.  It reads my .vimrc with no issues and behaves just great with Tim Pope&amp;#8217;s Rails plugin.&lt;/p&gt;
&lt;h3&gt;Modifying my Behavior&lt;/h3&gt;
&lt;p&gt;This is the hardest part of the switch.  I really hate my mouse and really thought that I had shun using it for many years now.  However, I find myself reaching for it to switch windows when a command-tab is easier.  It&amp;#8217;s strange if I&amp;#8217;m in my terminal I always command-tab to chrome but for some reason reach for the mouse when switching to macvim.  Now that macvim is no longer in the equation I still find myself reaching for the mouse to move from my bash tmux pane to my vim pane.&lt;/p&gt;
&lt;p&gt;Speaking of panes I run tmux full screen divided into 3 panes.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ecbearden/5448472584/&quot; title=&quot;tmux_vim_bash by ecbearden, on Flickr&quot;&gt;&lt;img src=&quot;http://farm6.static.flickr.com/5054/5448472584_730a2d1118_z.jpg&quot; width=&quot;640&quot; height=&quot;400&quot; alt=&quot;tmux_vim_bash&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;my .tmux.conf file:&lt;/p&gt;
&lt;pre&gt;
set -g prefix C-a
unbind C-b
bind C-a send-prefix

bind-key C-a last-window

# Set status bar
set -g status-bg blue
set -g status-fg white

# Highlight active window
set-window-option -g window-status-current-bg red

# Automatically set window title
setw -g automatic-rename

# use &quot;v&quot; and &quot;s&quot; to do vertical/horizontal splits, like vim
bind s split-window -v
bind v split-window -h

# use the vim motion keys to move between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# use vim motion keys while in copy mode
setw -g mode-keys vi
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
#
# # quick pane cyclingunbind ^A
bind ^A select-pane -t :.+
&lt;/pre&gt;</description>
      <pubDate>Tue, 15 Feb 2011 10:21:05 -0600</pubDate>
      <link>http://beardendesigns.com/blogs/permalink/73</link>
      <category>tmux/vim/iterm/iterm2</category>
      <guid>http://beardendesigns.com/blogs/show?73</guid>
    </item>
    <item>
      <title>read this post unless busy</title>
      <description>&lt;p&gt;I really like &lt;strong&gt;unless&lt;/strong&gt; but only if it makes something much more readable. Of course &lt;a href=&quot;http://37signals.com/svn/posts/2699-making-sense-with-rubys-unless&quot;&gt;Jamis beat me to it&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 14 Jan 2011 09:27:39 -0600</pubDate>
      <link>http://beardendesigns.com/blogs/permalink/72</link>
      <category>ruby</category>
      <guid>http://beardendesigns.com/blogs/show?72</guid>
    </item>
    <item>
      <title>We are hiring</title>
      <description>&lt;p&gt;Looking for a rails programmer with at least a Bachelors in Computer Science or Engineering and at least 2 years software development experience.  This is a full time position with benefits.&lt;/p&gt;
&lt;p&gt;We are a small but financially strong firm that expects a great attitude and superior skills. We are as agile, as possible :) and have a great passion for producing quality products.&lt;/p&gt;
&lt;p&gt;The software we build helps children and the underserved in our communities.  Your contribution will make a difference.&lt;/p&gt;
&lt;p&gt;There is some travel 2-3 times per year.&lt;/p&gt;
&lt;p&gt;Our office is near downtown in the trendy 5 Points/Riverside area.  Lots of weird people,  great restaurants and bars.&lt;/p&gt;
&lt;p&gt;When applying a cover letter is required and should address these concerns:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;When is the last time you created a complete RoR app? What did it do?&lt;/li&gt;
	&lt;li&gt;What does Array#reject! return ?&lt;/li&gt;
	&lt;li&gt;How do you continue your education in the field of computing?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Required Skills&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;Professional&lt;/li&gt;
	&lt;li&gt;Punctual&lt;/li&gt;
	&lt;li&gt;Great attitude&lt;/li&gt;
	&lt;li&gt;Exceptional Ruby Skills
	&lt;ul&gt;
		&lt;li&gt;Strong Ruby on Rails experience&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
	&lt;li&gt;2 years experience software development&lt;/li&gt;
	&lt;li&gt;Famililiar with agile methodologies&lt;/li&gt;
	&lt;li&gt;At least a BS in Computer Science or Engineering&lt;/li&gt;
	&lt;li&gt;mySQL&lt;/li&gt;
	&lt;li&gt;git&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Desired Skills&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;Deployment of RoR apps&lt;/li&gt;
	&lt;li&gt;Javascript fluent&lt;/li&gt;
	&lt;li&gt;Familiar with &lt;span class=&quot;caps&quot;&gt;YUI&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;Haml&lt;/li&gt;
	&lt;li&gt;sass/&lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Fri, 14 Jan 2011 09:20:02 -0600</pubDate>
      <link>http://beardendesigns.com/blogs/permalink/71</link>
      <category>employment</category>
      <guid>http://beardendesigns.com/blogs/show?71</guid>
    </item>
    <item>
      <title>EOY Ruby Roundup</title>
      <description>&lt;p&gt;I don&amp;#8217;t know how I missed this &lt;a href=&quot;http://www.rubyinside.com/ruby-in-2010-a-retrospective-4059.html&quot;&gt;&lt;span class=&quot;caps&quot;&gt;EOY&lt;/span&gt; Ruby Roundup&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Good stuff.&lt;/p&gt;</description>
      <pubDate>Fri, 14 Jan 2011 08:39:16 -0600</pubDate>
      <link>http://beardendesigns.com/blogs/permalink/70</link>
      <category>ruby</category>
      <guid>http://beardendesigns.com/blogs/show?70</guid>
    </item>
    <item>
      <title>Fair Balancing for nginx</title>
      <description>&lt;p&gt;If you have a busy server running multiple mongrels you probably have noticed how nginx will sometimes queue requests onto already busy mongrels while some mongrels are completely idle.&lt;/p&gt;
&lt;p&gt;There is now a fair balancer plugin for nginx that makes it fair rather than round robin.  It&amp;#8217;s easy to install.  Grab the the plugin &lt;a href=&quot;http://github.com/gnosek/nginx-upstream-fair&quot;&gt;here&lt;/a&gt; and grab the latest stable release of nginx (I&amp;#8217;m using 0.7.6) from &lt;a href=&quot;http://nginx.org/en/download.html&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Follow the directions on github:&lt;/p&gt;
&lt;h2&gt;Installation:&lt;/h2&gt;
&lt;p&gt;You&amp;#8217;ll need to re-compile Nginx from source to include this module.&lt;br /&gt;
Modify your compile of Nginx by adding the following directive&lt;br /&gt;
(modified to suit your path of course):&lt;/p&gt;
./configure &amp;#8212;with-http_ssl_module &amp;#8212;add-module=/absolute/path/to/nginx-upstream-fair
make
make install
&lt;h2&gt;Usage:&lt;/h2&gt;
&lt;p&gt;Change your Nginx config file&amp;#8217;s upstream block to include the &amp;#8216;fair&amp;#8217; directive:&lt;/p&gt;
upstream mongrel {
fair;
server 127.0.0.1:5000;
server 127.0.0.1:5001;
server 127.0.0.1:5002;
}
&lt;h2&gt;Caution&lt;/h2&gt;
&lt;p&gt;One issue I ran into was having to change my nginx config files that contained &lt;em&gt;false&lt;/em&gt; to &lt;em&gt;off&lt;/em&gt;.  For example:&lt;/p&gt;
&lt;p&gt;proxy_redirect false;&lt;/p&gt;
&lt;p&gt;now reads&lt;/p&gt;
&lt;p&gt;proxy_redirect off;&lt;/p&gt;</description>
      <pubDate>Thu, 28 Jan 2010 11:59:41 -0600</pubDate>
      <link>http://beardendesigns.com/blogs/permalink/69</link>
      <category>nginx</category>
      <guid>http://beardendesigns.com/blogs/show?69</guid>
    </item>
    <item>
      <title>De Morgan, Ruby</title>
      <description>&lt;pre class=&quot;ruby&quot; name=&quot;code&quot;&gt;
#De Morgan the Ruby way

[true,false].each do |p|
  [true,false].each do |q|
    puts &quot;p=#{p} q=#{q}&quot;
    if !(p or q) == (!p and !q)
      puts &quot;De Morgan Rules! !(p or q) == (!p and !q)&quot;
    else
      puts &quot;De Morgan is a Liar!&quot;
    end

    # if find yourself writing
    if !p and !q
      print &quot;-&quot;
      # you could be writing 
      unless p or q
        puts &quot;if !p and !q equivalent to unless p or q&quot;
      end
    end


    if !(p and q) == (!p or !q)
      puts &quot;De Morgan Rules! !(p and q) == (!p or !q)&quot;
    else
      puts &quot;De Morgan is a Liar!&quot;
    end

    # if find yourself writing
    if !p or !q
      print &quot;-&quot;
      # you could be writing 
      unless p and q
        puts &quot;if !p or !q equivalent to unless p and q&quot;
      end
    end

  end
end
&lt;/pre&gt;</description>
      <pubDate>Thu, 21 Jan 2010 12:46:23 -0600</pubDate>
      <link>http://beardendesigns.com/blogs/permalink/68</link>
      <category>ruby/logic</category>
      <guid>http://beardendesigns.com/blogs/show?68</guid>
    </item>
    <item>
      <title>Run individual shoulda tests</title>
      <description>&lt;p&gt;When you run tests of just one model or controller you usually do something like:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
  ruby test/unit/evaluation_test.rb
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you want to target just one test you can use the -n option&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
  ruby test/unit/evaluation_test.rb -n test_return_pending_evaluatees_from_composite_group
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;For shoulda users if you want to target just one test the -n option can also take regular expressions.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
  ruby test/unit/evaluation_test.rb -v -n &quot;/have many/&quot;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The -v lists the test name before every test, aka verbose mode.&lt;/p&gt;</description>
      <pubDate>Thu, 29 Oct 2009 18:17:16 -0500</pubDate>
      <link>http://beardendesigns.com/blogs/permalink/67</link>
      <category>testing/shoulda</category>
      <guid>http://beardendesigns.com/blogs/show?67</guid>
    </item>
    <item>
      <title>Please Spam This Post</title>
      <description>&lt;p&gt;Just updated the code to detect the spamming bastards.  Let&amp;#8217;s see if it works.&lt;/p&gt;</description>
      <pubDate>Tue, 15 Sep 2009 20:27:50 -0500</pubDate>
      <link>http://beardendesigns.com/blogs/permalink/66</link>
      <category>spam/site</category>
      <guid>http://beardendesigns.com/blogs/show?66</guid>
    </item>
    <item>
      <title>Pretty Local Rdoc</title>
      <description>&lt;p&gt;From the RubyInside site a couple of gems to make your local rdocs look and behave nicer.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/ecbearden/3417237029/&quot; title=&quot;activerecord-2.3.2 - Bdoc_1239019365281 by ratty.ella, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3592/3417237029_fae6312a70.jpg&quot; width=&quot;500&quot; height=&quot;451&quot; alt=&quot;activerecord-2.3.2 - Bdoc_1239019365281&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;To reap the benefits:&lt;/h2&gt;
sudo gem install mislav-hanna
sudo gem install manalang-bdoc
sudo hanna &amp;#8212;gems
bdoc</description>
      <pubDate>Mon, 06 Apr 2009 12:14:30 -0500</pubDate>
      <link>http://beardendesigns.com/blogs/permalink/65</link>
      <category>ruby/rails/bdoc/hanna</category>
      <guid>http://beardendesigns.com/blogs/show?65</guid>
    </item>
    <item>
      <title>Protect Staging Server with Password</title>
      <description>&lt;p&gt;When developing a new application and releasing often you may want to protect the site from prying eyes.  A simple way to do this when using the  nginx web server is to use basic http authentication.&lt;/p&gt;
&lt;p&gt;I prefer to do this in the nginx config file so it doesn&amp;#8217;t impact local development.&lt;/p&gt;
&lt;p&gt;You&amp;#8217;ll need to create a password file using htpasswd command line utility.  This file should be relative to the install directory of nginx.  The default install would place this file in /usr/local/nginx&lt;/p&gt;
sudo htpasswd -cb /usr/local/this_hosts_password_file username password
&lt;p&gt;Next,  you need to tell nginx to use basic auth for any access to this (virtual) host.  I place the 2 relevant lines in the &lt;em&gt;server&lt;/em&gt; portion of the config file&lt;/p&gt;
server {
listen  80;
&lt;ol&gt;
	&lt;li&gt;&amp;#8230;&lt;br /&gt;
    &lt;strong&gt;auth_basic &amp;#8220;Login to see this alpha site.&amp;#8221;;&lt;/strong&gt;&lt;br /&gt;
    &lt;strong&gt;auth_basic_user_file this_hosts_password_file;&lt;/strong&gt;&lt;/li&gt;
	&lt;li&gt;&amp;#8230;&lt;br /&gt;
  }&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A login will now be presented for any entry into the site.&lt;/p&gt;</description>
      <pubDate>Sat, 07 Mar 2009 13:20:50 -0600</pubDate>
      <link>http://beardendesigns.com/blogs/permalink/64</link>
      <category>rails/mongrel/ruby/nginx</category>
      <guid>http://beardendesigns.com/blogs/show?64</guid>
    </item>
  </channel>
</rss>
