Josh Thompson     about     archive     tags

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

2018 Reading Review & Recommendations

I read many books in 2018. I’m listing them out here, along with recommendations. Here’s the recommendation “key”:

  • 👍 = I recommend this book. (This metric is intentionally fuzzy.)
  • 😔 = This book influenced my mental model of the world/reality/myself
  • 🏢 = Book topic is architecture and/or urbanism
  • 💵 = Book topic is finance/economics/politics
  • 😫 = This book is hard to get through. Lengthy and/or academic
  • 🐲 = Fiction (most of the fiction I read had fantastic(al) creatures in them, hence the dragon)

If you want anything of value from this list, quickly skim through it. If any of the book topics/titles look of interest to you, consider reading. If a book doesn’t look interesting to you, but I’ve strongly recommended it, you should read it. :)

The tl;dr of the subsequent list of 70+ books is:

  1. Read The Problem of Political Authority: An Examination of the Right to Coerce and the Duty to Obey
  2. Read The Color of Law: A Forgotten History of How Our Government Segregated America
  3. If you’re a parent, or have friends who are parents, or might someday be a parent, consider reading How to Raise an Adult: Break Free of the Overparenting Trap and Prepare Your Kid for Success

I did this last year as well: Recommended books from 2017

Notes and Themes

I re-read The Problem of Political Authority, which continues to be my most recommended book. It contains straight-forward, elegant prose, provocative ideas, and perceptive analysis. What else could one want in a book?

I added a few lines on some of these books. Most I didn’t say anything about. I could have spoken at length on many, many more of these books, but it’s daunting to do so on such a list. This makes me want to re-do how I record thoughts on books. Hm.

I read (and finished) the Dresden Files series. All fifteen of them. I enjoyed the series immensely, though I didn’t mark them with a 👍 - if you’re into fiction, film noir, and crime-fighting wizards, this series is for you. If not, don’t waste your time. If you think reading should only be non-fiction to make you smarter, or “hard” fiction, to make you smarter - I disagree. The Dresden files were like candy. Easy, bite-sized, not complex, and delightful. Won’t kill you in small doses.

January

Dead Beat (The Dresden Files, #7) 🐲

The House of Morgan: An American Banking Dynasty and the Rise of Modern Finance 😔 💵 😫

This is Ron Chernow’s first biography. Ron Chernow has authored many other biographies, including the Hamilton biography that inspired the musical. The institution we know today as “JP Morgan Chase” had an interesting start and history. After reading Money, Bank Credit, and Economic Cycles here’s my analysis on MBCEC, for the curious, I have little appreciation for large banks doing their leveraged buyouts and functionally fraudulent activities, but it’s still interesting to know the basics of such a prominent institution in America.

For a while, the bank had more of a say in international relations than the US government did. The government had limited access to capital, and the bank could provide it, so large banks played a role in “cracking open” south/central America and Asia, often with many deleterious effects in those regions.

The Death and Life of Great American Cities 😔 👍 🏢 💵

Jane Jacobs is a hero. She loves cities, and when you’re done reading this book, you might love them too. She identified huge problems in the 50’s with the profession of “city planning”, and most of the industry is clueless to her critiques, bumbling along, making the same errors they always did. (Sorta like doctors draining “bad humors”.)

I think most of the built environment in America is headed straight for insolvency and bankruptcy, and if there was a time to change bad practices to good ones, it passed long ago. But this book is still a must-read.

Crazy Busy: A (Mercifully) Short Book about a (Really) Big Problem

Preludes & Nocturnes (The Sandman, #1) 👍 🐲

This is the first comic book I’ve read in many years. I loved it. I wish my library had the rest of the series.

>> Read more

Pry-ing into a Stack Trace

I was recently working on a feature, committed what I thought was clean code, and started getting errors. I git stashed, and re-ran my tests, and still got errors. Here’s the full stacktrace:

> b ruby -Itest test/models/model_name_redacted_test.rb -n=/errors/

# Running tests with run options -n=/errors/ --seed 55842:

/Users/joshthompson/.rvm/gems/ruby-2.3.7/gems/minitest-reporters-1.3.5/lib/minitest/reporters/default_reporter.rb:49:in `after_suite': undefined method `name' for nil:NilClass (NoMethodError)
	from /Users/joshthompson/.rvm/gems/ruby-2.3.7/gems/minitest-reporters-1.3.5/lib/minitest/reporters/base_reporter.rb:59:in `report'
	from /Users/joshthompson/.rvm/gems/ruby-2.3.7/gems/minitest-reporters-1.3.5/lib/minitest/reporters/default_reporter.rb:89:in `report'
	from /Users/joshthompson/.rvm/gems/ruby-2.3.7/gems/minitest-reporters-1.3.5/lib/minitest/minitest_reporter_plugin.rb:26:in `each'
	from /Users/joshthompson/.rvm/gems/ruby-2.3.7/gems/minitest-reporters-1.3.5/lib/minitest/minitest_reporter_plugin.rb:26:in `report'
	from /Users/joshthompson/.rvm/gems/ruby-2.3.7/gems/minitest-5.11.3/lib/minitest.rb:808:in `each'
	from /Users/joshthompson/.rvm/gems/ruby-2.3.7/gems/minitest-5.11.3/lib/minitest.rb:808:in `report'
	from /Users/joshthompson/.rvm/gems/ruby-2.3.7/gems/minitest-5.11.3/lib/minitest.rb:141:in `run'
	from /Users/joshthompson/.rvm/gems/ruby-2.3.7/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
Coverage report generated for Unit Tests to /Users/joshthompson/wombat/threatsim-rails/threatsim/coverage. 1512 / 17964 LOC (8.42%) covered.

This is a relatively common error. Something is nil where it ought not to be nil.

But now for the kicker.

I found out that if you hold the cmd key down and click one of those file paths, the file in question will open in your editor!!!

AND YOU CAN JUST PUT A PRY IN THERE SOMEWHERE AND YOU’LL HIT IT NEXT TIME THAT LINE OF CODE EXECUTES!!!

>> Read more