Josh Thompson     About     Archive

Switching to Jekyll

A few days ago, I was really feeling the urge to write a short little blog post. So, I put it in a gist on Github.

I’m an advocate of writing publicly, and making it a habit, so why was I putting it in a gist, instead of here, on my website, where I theoretically can write and publish anything I want?

Friction

It’s very easy for me to sketch out a quick document with embedded screenshots in a text editor. I spend most of my day in a text editor anyway, so it’s trivially easy to write a new document.

I can add code snippets, links, images, and have nicely formatted text, just the way that I like it, in a gist.

SquareSpace, the service I was using for my website, is not designed for people who write in Markdown. SquareSpace is very good at many things, but not the things I needed. Practically Efficient says it better than I can.

So, last week, I decided that if I didn’t make my writing and publishing easy, I would probably just stop writing.

>> Read more

Finding an Edge

These last two weeks have been the hardest, or the most frustrating, of my time at Turing so far.

I’ve been put a little off-balance by this difficulty, and I think I’m close to uncovering some useful tidbit or idea that will serve me well, and might serve someone else too.

Several different people warned me that

Mod 3 is just like mod 1 in terms of difficulty

I wasn’t sure what to make of that, because Mod 1 wasn’t too bad of a struggle. I think I gave myself a bad case of the “mismatched expectations”.

>> Read more

On Cleaner Controllers

A few days ago, I worked on a project that was mostly about serving up basic store data (modeled after Etsy) to an API.

We had a few dozen end-points, and all responses were in JSON.

Most of the action happened inside of our controllers, and as you might imagine, our routes.rb file was bananas.

One of the instructors made an exceptionally simple suggestion, I was embarrassed to not have seen it.

It was about nesting our controllers a bit better.

For context, here’s our routes for our merchants objects, relationships, and analytics:

Rails.application.routes.draw do
  namespace :api, defaults: {format: :json} do
    namespace :v1 do
      resources :merchants, only: [:index, :show], :controller => "merchants/merchants" do
        get "items", to: "merchants/merchant_items#index"
        get "invoices", to: "merchants/merchant_invoices#index"
        get "customers_with_pending_invoices", to: "merchants/merchant_pending_customers#index"
        get "favorite_customer", to: "merchants/merchant_favorite_customer#show"
        get "revenue", to: "merchants/merchant_revenue#show"
        collection do
          get "most_items", to: "merchants/merchants_most_items#index"
          get "most_revenue", to: "merchants/merchants_most_revenue#index"
          get "revenue", to: "merchants/merchants_revenue#show"
          get "find", to: "merchants/merchants_find#show"
          get "find_all", to: "merchants/merchants_find#index"
          get "random", to: "merchants/merchants_random#show"
        end
      .
    .
  .
>> Read more

Tour of D3 for Clueless Folk Like Me

D3 stands for Data Driven Documents, and it’s the coolest thing ever.

Check out a few examples:

So, this is the kind of stuff you can do with D3. The Front-end track at Turing gave a short lesson on D3, and I was one of two back-end folks participating. This was actually really encouraging, because they didn’t know much about d3 either.

So, lets dig into D3 a bit, and do two things:

  1. Get a running d3 map running locally (we’re gonna use circle wave)
  2. Deconstruct a simple d3 project to it’s minimum components, expecting that we’ll learn something along the way.
>> Read more

Playing with the HTTP send/response cycle in Ruby, without Faraday

note (that’s me): I’ve written a lot over the last few months of Turing, but my list of public gists is getting so long I can barely keep track of it. So, as I write longer things that I think might be useful to others (especially Turing students) I’m going to stick it here. If you’re not interested in Turing or programming, it’s safe to skip this particular post. D3 stands for Data Driven Documents, and it’s the coolest thing ever.

Check out a few examples:

So, this is the kind of stuff you can do with D3. The Front-end track at Turing gave a short lesson on D3, and I was one of two back-end folks participating. This was actually really encouraging, because they didn’t know much about d3 either.

So, lets dig into D3 a bit, and do two things:

  1. Get a running d3 map running locally (we’re gonna use circle wave)
  2. Deconstruct a simple d3 project to it’s minimum components, expecting that we’ll learn something along the way.

Note to the reader: I know _almost nothing about frontend tools. If you’re comfortable on the front-end, bear with my ignorance. If you, too, know nothing about the front-end, great! This should be at your level._

Running circle-wave locally

  • you’ll need a text editor and a browser. I’m using Chrome and Atom.
  • you’ll need to be able to open up various files on your computer in Chrome and your text editor. My tool of choice is the command line + iterm + zsh.

First, have a folder you can stick this all in. I’ve got /d3/circle-wave/

>> Read more