Skip to content

Instantly share code, notes, and snippets.

View mathie's full-sized avatar

Graeme Mathieson mathie

View GitHub Profile

Essentially, in a software development project, there are three variables we can play with: quality, scope, and timescale (which is directly linked to cost, both in terms of development cost, and opportunity cost).

Quality is the easiest one to cover. Most of the time you don’t want to muck around with quality, though, by not acknowledging it explicitly, it’s often the one that’s sacrificed. Dropping quality is essentially an exercise in deferring cost. If we cut corners, then we’ll build up technical debt, which will have to be paid off later. So dropping quality increases the long term total cost of ownership, because it’s harder to fix bad code that customers are already dependent upon than it is to write good quality code in the first case. One way to trade off quality vs opportunity cost (speed to market) is to explicitly accept that we’re building a prototype in order to test the market, and that the prototype is likely to be thrown away when we build the ‘proper’ system.

So I guess the first question

@mathie
mathie / presentation.md
Last active December 4, 2022 17:02
How the Internet Works

footer: © 2015 Graeme Mathieson. CC BY-SA 4.0. slidenumbers: true

Type “google.com” into you browser and hit enter

What happens next?

^ I haven’t done any interviewing for a while but I went through a period of growth in one of the companies I worked for where we were feverishly expanding the development team, so we had to be a little more systematic in our approach to interviewing. Instead of just having an open conversation with candidates to see where it led (which is what I’d previously done in such situations), I wound up preparing a ‘standard’ set of questions. It took a few goes, but eventually I settled on a favourite question for the technical portion of the interview:

^ When I pull up my favourite Internet browser, type “google.com” into the address bar, and press return, what happens?

@mathie
mathie / binding.clj
Created September 7, 2013 09:02
Demonstrating late binding in Clojure for @mr_urf
user=> (def foo 'hello)
#'user/foo
user=> (defn bar [] foo)
#'user/bar
user=> (bar)
hello
user=> (def foo 'world)
#'user/foo
user=> (bar)
world
@mathie
mathie / gist:1111
Created July 22, 2008 16:00 — forked from st23am/gist:1098
def test
str = "this is a test of new pastie"
# print out the test msg
puts str
end
@mathie
mathie / phantomjs.pp
Created April 14, 2013 15:15
Puppet class for installing phantomjs. An example of using curl to grab a tarball for installation.
class phantomjs {
include xvfb
$version = '1.8.1'
$basename = "phantomjs-${version}-linux-x86_64"
$tarball = "${basename}.tar.bz2"
$tarball_path = "/opt/${tarball}"
$url = "http://phantomjs.googlecode.com/files/${tarball}"
$destdir = "/opt/${basename}"
# My new git commit shortcut, thanks to http://whatthecommit.com/ :-)
alias commit='git commit -m "$(curl -s http://whatthecommit.com/ |grep '<p>' |cut -c 4-)"'
@mathie
mathie / puma.rb
Created June 5, 2016 08:03
Puma configuration
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
@mathie
mathie / foreman.log
Created June 3, 2016 16:36
Puma log output on a vanilla-ish Rails 5.rc3
> foreman start Personal/amazon_link 2.3.1 master@c244df1
17:34:43 web.1 | started with pid 75366
17:34:43 web.1 | [75366] Puma starting in cluster mode...
17:34:43 web.1 | [75366] * Version 3.4.0 (ruby 2.3.1-p112), codename: Owl Bowl Brawl
17:34:43 web.1 | [75366] * Min threads: 5, max threads: 5
17:34:43 web.1 | [75366] * Environment: development
17:34:43 web.1 | [75366] * Process workers: 2
17:34:43 web.1 | [75366] * Preloading application
17:34:45 web.1 | [75366] * Listening on tcp://0.0.0.0:5000
17:34:45 web.1 | [75366] ! WARNING: Detected 25 Thread(s) started in app boot:
> bundle exec middleman build
create build/stylesheets/site.css
create build/javascripts/all.js
create build/images/middleman-logo.svg
create build/index.html
Project built successfully.
> cd the-internet.io
> git init
Initialized empty Git repository in /Users/mathie/Development/Personal/the-internet.io/.git/
> git add .
> git commit -m 'middleman init the-internet.io' Personal/the-internet.io 2.3.1 master@ ●
[master (root-commit) f6a4d2c] middleman init the-internet.io
11 files changed, 756 insertions(+)
create mode 100644 .gitignore
create mode 100644 Gemfile
create mode 100644 Gemfile.lock