Skip to content

Instantly share code, notes, and snippets.

Josh Thompson josh-works

Block or report user

Report or block josh-works

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
josh-works /
Last active Jul 6, 2019
Make the terminal more usable, common commands

Make your terminal more usable

You're going to spend all day looking at your terminal. Make it be kind to you.

Part 1

Here's a video walk-through of part 1 of this guide:

[![Play the video][image0]][hyperlink0]

josh-works /
Last active Jun 20, 2019
mythical creatures, prework, ruby exercises, turing, ruby

Make mod 1 easier than it otherwise would be: a guide

This guide will make Turing's mod 1 much easier than it otherwise would be.

note: please see the updated version of this guide; if you continue reading, you'll have a far inferior experience than if you head over here:

We'll do this by working on, (and completing) a few dozen small Ruby exercises.

You might be thinking:

Josh. This already sounds like a lot of work. I just finished my prework, and I know Turing's gonna be brutal. Why should I do all of this optional work, instead of enjoying my last few days of freedom?

josh-works / exceptional_values.rb
Last active Oct 13, 2018
test, and the code that makes the test pass, to understand whole values and exceptional values, from Avdi Grim's
View exceptional_values.rb
class Object
def exceptional?
Course =, :duration) do
def duration=(new_duration)
self[:duration] = Duration(new_duration)

Learning is cool.

Learning how to learn is a super power.

Lets look at the lense of learning a new language:

At the most tactical level, we would be studying the language itself. Reading a children's book in the target language, or making and studying flashcards.

At a higher level, we would be considering how we can best study the language. Flash cards? Reading children's books in the foreign language? Passive or active learning? etc.


On Learning

topics: {
      DEEP WORK:
        protect and cultivate (limited) attention,
        ear plugs,
        skeptical of music,
        examine your own process,
josh-works /
Last active Jul 18, 2018
An opinionated guide of how to use your time between finishing the prework, and starting Turing.
josh-works /
Last active Apr 13, 2018
ruby, benchmarking, double_inject

Double inject. What does it mean?

i want to know how long it takes to do some stuff. I've got some code like this:

def count_stuff(list)
  list.inject([]) do |results, item|
    results << get_results_from_something_else(values)

I needed a URL validator - it needed to check that URL's had HTTP or HTTPS at the beginning. I initially wrote a "before save" action, but didn't like it cluttering up my model. I found a reference to basically "monkey patching" Rail's default Validator class, so that's what I did!

# concerns/url_validator.rb
require 'uri'

class UrlValidator < ActiveModel::Validator

  def validate(record)
    if record.url?

Better workflow (leads to) better questions (leads to) better jobs

We'll cover two things:

  1. Have a great workflow
  2. Ask great questions


From Regis, who will cover the "workflow" portion of the spike

You can’t perform that action at this time.