Skip to content

Instantly share code, notes, and snippets.

@sarahmei
sarahmei / gist:3650927
Created September 6, 2012 03:43
The Insufficiency of Good Design
The Insufficiency of Good Design
We all want to write good code, and there is no shortage of advice on
how to do that. SOLID. SOA. SRP. LoD. These are undoubtedly important,
but none of them address the single factor that has the biggest impact
on the quality of a codebase.
That factor is Other People. The people you're working with affect the
codebase more than you do, in aggregate, if there's more than a few of
them. And it's not just the individuals. How your team is organized,
it "contains public posts from people you're following" do
# Alice follows Eve, but Eve does not follow Alice
alice.contacts.create!(:person => eve.person, :aspects => [@alices_aspect], :receiving => true, :sharing => false)
# Eve posts a public status message
eves_public_post = eve.post(:status_message, :text => "hello", :to => 'all', :public => true)
# Alice should see it
alice.visible_shareable_ids(Post).should include(eves_public_post.id)
end
<div id='content'>
<h1>Sarah Mei</h1>
<div id='content_inner'>
<div class='entity_profile vcard author' id='i'>
<h2>User profile</h2>
<dl class='entity_nickname'>
<dt>Nickname</dt>
<dd>
<a class='nickname url uid' href='https://otherpod.com/' rel='me'>Sarah Mei</a>
</dd>
<?xml version='1.0' encoding='UTF-8'?>
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0' xmlns:hm='http://host-meta.net/xrd/1.0'>
<hm:Host>otherpod.com</hm:Host>
<Link rel='lrdd' template='https://otherpod.com/webfinger?q={uri}'>
<Title>Resource Descriptor</Title>
</Link>
</XRD>
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Subject>acct:sarah@otherpod.com</Subject>
<Alias>"https://otherpod.com/"</Alias>
<Link rel="http://microformats.org/profile/hcard" type="text/html" href="https://otherpod.com/hcard/users/4cec1e372c174347b90000ad"/>
<Link rel="http://otherpod.com/seed_location" type = 'text/html' href="https://otherpod.com/"/>
<Link rel="http://otherpod.com/guid" type = 'text/html' href="4cec1e372c174347b90000ad"/>
<Link rel='http://webfinger.net/rel/profile-page' type='text/html' href='https://otherpod.com/u/sarah'/>
<Link rel="http://schemas.google.com/g/2010#updates-from" type="application/atom+xml" href="https://otherpod.com/public/sarah.atom"/>
<Link rel="diaspora-public-key" type = 'RSA' href="[public key omitted for length]"/>
- content_for :page_title do
DIASPORA* ALPHA
- begin
= render :partial => 'home/show'
- rescue Exception => e
= e.inspect
:css
header{
display:none;
}
XVFB=/usr/bin/Xvfb
XVFBARGS=":99 -ac -screen 0 1024x768x16"
PIDFILE=/tmp/cucumber_xvfb_99.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
/sbin/start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)
context "mobile" do
it "renders a share button when you don't pass aspect IDs" do
get :index, :format => :mobile
response.body.should =~ /#{Regexp.escape('id="status_message_submit"')}/
end
it "renders a share button when you pass aspect IDs" do
get :index, :a_ids => [@alices_aspect_1], :format => :mobile
response.body.should =~ /#{Regexp.escape('id="status_message_submit"')}/
end
if Gem::VERSION >= "1.3.6"
module Rails
class GemDependency
def requirement
r = super
(r == Gem::Requirement.default) ? nil : r
end
end
end
end
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:80
cruise data root = '/home/smei/.cruise'
./lib/cruise_control/../../vendor/rails/railties/lib/rails/gem_dependency.rb:99:
in `requirement':
undefined local variable or method `version_requirements' for
#<Rails::GemDependency:0x7fd0d5382090> (NameError)