Josh Thompson     about     archive     tags

VCR's debug_logger and `git diff`

I recently added the vcr gem to one of our repositories, and was adding tests for an external API.

One of my tests was passing, and I wanted to commit the VCR cassette, along with the test/code that went with it.

I had thought I’d rebuilt the VCR cassette a few minutes before, but when I did git status, none of the expected files showed up. VCR cassettes record API calls and store them as big .yml files, which should show up in git status:

useless git status

This did not map to my expectation - I expected to see the VCR cassette.

Two tools to help find the missing cassettes

First, I had to make sure the cassettes actually existed and were being used in my tests. Second, assuming the cassettes existed, I had to find them.

I checked the test_helper.rb, to see where the cassettes were supposed to be stashed:

VCR.configure do |config|
  config.cassette_library_dir = "fixtures/vcr_cassettes"
  config.hook_into :webmock
end
>> Read more

Climbing in Cuba, 2019

A few weeks ago, I had the opportunity to go climbing in Cuba.

mark and dave Mark and Dave, walking back from climbing outside Viñales

The roof of the world Locals crag, called “The roof of the world”. Stunning routes.

We spent a lot of time in this cave because it was so hot, we spent a lot of time in this cave.

>> Read more

Some Lessons Learned While Preparing for Two Technical Talks

A few weeks ago, I gave two talks about Ruby and Rails:

  1. An 8-minute “lightning talk” about using .count vs .size in ActiveRecord query methods
  2. A 30-minute talk at the Boulder Ruby Group arguing that developers should embrace working with non-development business functions, and the constraints therein. I illustrated this via a story about finding slow SQL queries, and using .count vs .size in ActiveRecord query methods.

Things that went well

  • I enjoyed actually giving the talks
  • I heard positive feedback after-the-fact
  • I learned a lot from the process, and next time the prep will be much less anxiety-inducing

Things that went poorly

  • I felt quite anxious in the ten days or so leading up to the talks, thought it was because I was procrastinating.
  • I felt stressed and shameful about not having the talks prepared.
  • I did not finalize either talk until few minutes before leaving to give it, and was up late at night the night before each talk, doing the lions share of the preparation, therefore I was sleep deprived.
>> Read more

HTTParty and to_json

I was having some trouble debugging an HTTParty POST request.

A few tools that were useful to me:

  1. post DEBUG info to STDOUT
  2. netcat to listen to HTTP requests locally

I had this code:

options = {
  headers: {
    "Content-Type": "application/json",
    authorization: "Bearer #{our_token}",
  },
  query: { data: true },
  body: { token: their_token },
  debug_output: STDOUT
}

And when I posted it:

HTTParty.post("#{BASE_URL}/endpoint", options)

I kept getting something like this:

opening connection to externalservice.net:443...
opened
starting SSL for externalservice.net:443...
SSL established
<- "POST /endpoint?data=true HTTP/1.1\r\nContent-Type: application/json\r\nAuthorization: Bearer alksdjflkajsdf\r\nHost: externalservice.net\r\nContent-Length: 1234\r\n\r\n"
<- "token=aslsdjfhasiudyfkajn"
-> "HTTP/1.1 400 Bad Request\r\n"
-> "Date: Mon, 11 Mar 2019 16:58:13 GMT\r\n"
-> "Content-Type: text/plain\r\n"
-> "Content-Length: 28\r\n"
-> "\r\n"
reading 28 bytes...
-> "Invalid json line 1 column 7"
read 28 bytes
Conn keep-alive
=> "Invalid json line 1 column 7"
>> Read more

Remote Job Hunting Resources for Turing Grads and Anyone Else

This post started life as this gist, and existed in that state for a while. I’m pulling it into a slightly more visible location, and updating/modifying it, hopefully to the betterment of all future readers.


This is a collection of resources that come from a range of conversations I’ve had with Turing students. Some of it is specific to getting/working remotely, but most of it is (in my opinion) useful for any sort of role. Finally, I think “advice to others” is a tall order. All I know is things I did, and what seemed to correlate with good results. Correlation is not causation, etc.

Where do remote jobs “live”

I’ve had the most success getting email responses from a few places:

  1. http://weworkremotely.com/

Second, hacker news’ “who’s hiring” threads, like this one from December 2017: https://news.ycombinator.com/item?id=15824597

oh, and with the hacker news posts, they’re often hundreds of entries long. I.E. hundreds of potential jobs.

I use this javascript in the console to filter the "who's hiring" threads by keyword. At a minimum, I'd add "remote" as criteria: [https://gist.github.com/kristopolous/19260ae54967c2219da8](https://gist.github.com/kristopolous/19260ae54967c2219da8)

This resource is 100x better than the above gist: https://kennytilton.github.io/whoishiring/

https://nomadlist.com/ is also worth a mention.

What sort of things did I do to actually get the job

My goal was to telegraph competence to anyone I interacted with. So, one of my main goals was to create visible evidence that I am competent.

That’s not helpful, Josh. How do you do that? Do you run around screaming “I’M COMPETENT” at everyone you meet?

>> Read more