Sold 2003 Landrover Discovery II $1900

SHE SOLD

 

If you don’t know this vehicle stop reading.  She’s not for you.  Landrovers don’t leak oil, they mark their territory.  This one has seen a lot of love.  Pictures below.

Work I’ve done in the last 2 years:

New Head Gasket and the entire Engine Seal Rebuild.

Basically this kit from Atlantic British:
Land Rover Discovery Head gasket Set

 

 

 

 

 

New Battery, New Starter Motor, New Alternator, New (refurbished radiator), New (refurbished) steering pump, A/C Refrigerant Refresh, New Thermostat, New Coolant Reservoir, Replaced front main driveshaft couple, New Plugs and Plug Wires (The good kind).

Continue reading “Sold 2003 Landrover Discovery II $1900”

Rspec Candies and Cookies

it "include_hash tests nested hashes" do
 { foo: 'a', bar: {nested_hash: {fi: 'c', baz:'b'} }}.should include_nested_hash(nested_hash: {fi: 'c', baz:'b'})
 end

Combining Mandraka’s  Rspec Candy with this little find from CookiesHQ, led me to a nested hash matcher

Very useful for testing API responses.


def find_first_value_for(hsh, key)
 return hsh[key] if hsh[key]
 hsh.values.each do |hash_value|
   values = [hash_value] unless hash_value.is_a? Array
   values.each{ |value|   return find_first_value_for(value, key) if value.is_a? Hash }
 end
end

RSpec::Matchers.define :include_nested_hash do |expected|
 match do |actual|
   if !actual.nil? and expected.is_a? Hash
     if expected.keys.count > 1
       keys.map do |key|
         value = find_first_value_for actual(actual, key)
         !value.nil? ? {key.to_sym => value} : {}
       end
     elsif expected.keys.count == 1
      {expected.keys.first => find_first_value_for(actual, expected.keys.first)}
     else
      {}
     end
     !actual.nil? && result == expected
   else
     false
   end
 end
end

Just include it in your spec_helper.rb or custom matcher module then test with something like this:

context "when testing with rspec candy" do
 it "include_hash is available" do
 { foo: 'a', bar: 'b' }.should include_hash(foo: 'a')
 end
 it "include_hash tests nested hashes" do
 { foo: 'a', bar: {nested_hash: {fi: 'c', baz:'b'} }}.should include_nested_hash(nested_hash: {fi: 'c', baz:'b'})
 end
end

Email hack from angelist angel.co

Very often I receive or send an introduction email to two parties, either for a general introduction or to help solve a specific problem. Usually it’s the two parties being introduced who need to chat, and not me. So I do what I’ve seed to be the common pattern and asked to be moved to bcc so that when they hit reply all I am taken out of the chain. I also do the same when someone introduces me, and It’s clear that the introducer shouldn’t be in on the continuing email chain.

Here’s an example:

Intro Email pattern

Today however I received an intro email from angel.co (Angle list’s return email) and in the email they did something very clever. their email is below. When I hit reply all (which I did lazily as a guaranteed way to include the other person in the email) there was no sign of the angel.co address in the to or cc fields.

intro email that doesn't include sender's email in the reply-to field

They did this by manipulating the reply-to header in the email chain. It may be an old hack or an old trick, or even part of the design of the email standard to begin with. But I’ve never manipulated the reply-to field before and this is absolutely a great way to handle emails connection between two users. Not only is the other part in the email chain, and the send is not on reply-all, it also works for regular reply. Here is an edited version of the headers. I also noticed that mail was processed by SendGrid, so maybe this is actually a feature of sendgrid’s email management service, but in any case, I think it’s brilliant and clever.

Subject: Intro - Ashley, Someone (Example Company)
From: AngelList Talent <talent@angel.co>
Date: 1/16/14, 3:05 PM
To: Ashley@Raiteri.net, someone@example.com
Return-path: <bounces+13051-3f53-ashley=raiteri.net@send.angel.co>
Envelope-to: ashley@raiteri.net
Delivery-date: Thu, 16 Jan 2014 18:05:17 -0500
Received: from o1.send.angel.co ([74.63.231.121]:55752) by ...
Received: by mf227.sendgrid.net with SMTP id mf227.26522.52D865A98 Thu, 16 Jan 2014 23:05:13 +0000 (UTC)
Received: from angel.co (ec2-50-18-6-138.us-west-1.compute.amazonaws.com [50.18.6.138]) by ismtpd-026 (SG) with ESMTP id 1439d4d1dc8.12bc3.5ed92 Thu, 16 Jan 2014 23:05:13 +0000 (GMT)
Reply-To: Ashley@Raiteri.net, someone@example.com
Message-ID: <52d865a95d6ac_e2638aff4444aa@job01.tmail>

X-Spam-Flag: NO
Reply-to: Ashley@Raiteri.net, someone@example.com

New match: Introducing Ashley to PersonName at Example Company
You're both cc'ed on this email. You should both reply and set up a time to connect.

Ashley Raiteri
Technical Advisor on Scalability, Data Science, Product and Funding