Composing a Nested Elasticsearch Query in Golang

TL;DR: A well-composed elasticsearch query is a beautiful thing, but it’s easy to get lost on the way there. This post is one path. Stay clear-headed from the top down and you should be fine.


Elasticsearch is a fast database with a powerful query language.

Golang is a fine language to build an app with, and with a little work, you can use it to present a clean search abstraction to the rest of your app.

Requirements

  • I’m running Elasticsearch (v2.3) via Docker Native on my mac
  • I’m running go1.7beta1
  • The source code for this whole post is available here

The dataset: Pokemon trainers with nested Poke-docs

Pokemon is topical enough to give us a nested data structure. We’re going to be working with a trainer type that has a nested property pokemon, which is a type: nested array on the doc.

The mapping:

mappings:
  trainer:
    properties:
      name:
        type: string
      hometown:
        type: string
      pokemon:
        type: nested
        properties:
          name:
            type: string
          level:
            type: long

type: nested?

Nested documents in elasticsearch maintain the associations you’d expect.

Take this trainer:

{
  "name": "Ash",
  "pokemon": [
    { "name": "Pikachu", "level": 7 },
    { "name": "Charizard", "level": 45 },
  ]
}

If our mapping did not mark the type of field pokemon as nested, elasticsearch would have flattend these pokemon onto the trainer object.

// Pseudo code: Elasticsearch internals (via Lucene)
{
  "name": "ash",
  "pokemon.name": ["pikachu", "charizard"]
  "pokemon.level": [7, 45]
}

Searches for a level 45 pikachu would return this trainer, when in fact he has no such thing!

Using type: nested tells elasticsearch to store each of these as separate documents. This lets us to search for individual pokemon on trainers, but also requires us to build a nested query - elasticsearch does not do that work for us.

Elasticsearch doesn’t store nested documents on the root doc at all, which can be a performance improvement for your queries that don’t touch the nested object - especially if those nested pokemon add significant size to the document.

Anyone have a Level 19 Magikarp?

Our goal with this query builder will be an abstraction that we can use to search for trainers. Specifically, we want to find a trainer with a pokemon matching our search criteria.

Something like:

// Golang!
trainers, err := Storage.FetchTrainers(&TrainerSearchOpts{
  Pokemon: "Magikarp",
  Level: 19,
})

Basics first

A basic FetchTrainers via olivere/elastic might look like:

// FetchTrainers queries trainers with the passed options
func (s *Store) FetchTrainers(opts TrainerSearchOpts) ([]*trainers.Trainer, error) {
	query := elastic.NewMatchAllQuery()

	res, err := s.es.Search(s.trainerIndex).Type(s.trainerType).Query(query).Do()
	if err != nil {
		return nil, err
	}

	var trns []*trainers.Trainer
	for _, iT := range res.Each(reflect.TypeOf(&trainers.Trainer{})) {
		trns = append(trns, iT.(*trainers.Trainer))
	}
	return trns, nil
}

We’re going to refactor this into a nested query that uses a filter to limit the returned trainers to those with a pokemon matching the search.

Learn that Bool Query

The Bool Query is the key to composability in elasticsearch queries. You can read more in the docs, but the gist is that you can attach arrays of subqueries to a single Bool Query, and it is treated as a single query wherever you drop it in.

At our top-level query, we’re going to create a Bool query and then attach a Filter. If no other queries are attached, Bool Queries default to using a "match_all", so attaching a Filter will limit the results to everything in the index that gets through our filter.

// switch to a Bool query
query := elastic.NewBoolQuery()
// set some filters
query = query.Filter(buildFilters(opts)...)

Where that nested magic happens

We need to implement the buildFilters function used above. It should return a slice of filters relevant to our query - in this case, we want to limit the results to our search criteria.

func buildFilters(opts TrainerSearchOpts) []elastic.Query {
	return []elastic.Query{
		elastic.NewNestedQuery(
			"pokemon",
			elastic.NewMatchQuery("pokemon.name", opts.Pokemon),
		),
	}
}

We use NewNestedQuery(path string, query elastic.Query) to get a nested query, then set a match query for a pokemon’s name.

This works fine for filtering on a single field, and leaves it easy for us to add more filters of our choosing (perhaps on a trainer’s badges or items). However, the moment we want to search for a more specific nested pokemon, this will start to get a little messy.

Notable here: if you were to add a second nested filter to buildFilters()’s slice that matched on a pokemon’s level, the queries would not be applied to the same pokemon. Queries that you want to apply to the same nested object must live on the same nested query.

Let’s go ahead and refactor it:

func buildFilters(opts TrainerSearchOpts) []elastic.Query {
	return []elastic.Query{
		elastic.NewNestedQuery(
			"pokemon",
			buildPokemonFilter(opts)
		),
	}
}

func buildPokemonFilter(opts TrainerSearchOpts) elastic.Query {
	return elastic.NewBoolQuery().Filter(
		elastic.NewMatchQuery("pokemon.name", opts.Pokemon),
		elastic.NewMatchQuery("pokemon.level", opts.Level),
	)
}

Here we’re using the composability of the Bool Query again - we want both our Match queries to apply as a single boolean signal to the nested Query above.

Off to the Pokemon League!

This could be taken much farther, and the design should be shaped by the API you want to expose. I don’t have a strong search story yet here, but if you want to see this taken a few steps farther, leave a comment with your use-case, I’m happy to keep extending the metaphor.

I hope this helps unlock your use of Elasticsearch in Golang! Good luck catching them all!

Full source code.

WTF is JavaScript? Context for a Green Dev.

TL;DR: An attempt at providing some context for JavaScript.

There are plenty of tools for learning JavaScript. The intent for this post is to provide some general context for JavaScript’s place in the contemporary development community.

The intended audience is those wanting to commit to learning to code, but who have minimal experience. I aim to provide a quick background on things I wish I’d groked (i.e., understood) sooner.

Any feedback would be massively appreciated!


What the what is JavaScript?

When people ask what JavaScript is, I usually say it’s the thing that makes websites interactive.

When a website is running in a browser (right now), there are 3 languages that make it happen: HTML, CSS, and JavaScript. HTML is the content: the headlines, the paragraphs, the buttons, the links. CSS styles this content, setting fonts, colors, layout, and handling animations. JavaScript performs actions associated with websites, such as sending data from the browser to the server, saving items to a shopping cart as you browse, or loading more content as you scroll down.

We call working with these browser languages “front-end” development. When you click a button to login to a website, front-end JavaScript code takes that username and password, shapes it into a nice and compact data format, and sends it off to another computer. This other computer is usually referred to as a “server”, and that’s where “back-end” development happens.

That server (aka computer) that’s waiting for your password? That could be running JavaScript too, or any other programming language. Javascript has recently (in the last 5 or so years) become a popular back-end language through a framework called NodeJS.

JavaScript runs in every browser

JavaScript is special because every modern browser uses it to run websites. The ubiquitous adoption across Chrome, Firefox, Safari, and Internet Explorer has created the internet as we know it. The result is an explosion of opportunity and demand for websites that use Javascript to get things done.

This browser adoption combined with the stabilization of NodeJS has given rise to the current JavaScript community: it is certainly one of the most popular languages in the world, and can be used for just about everything.

The JavaScript community is anyone who writes JavaScript. Welcome! Developers use it to build businesses, personal websites, blogs, games, and more tools to make writing code easier.


JavaScript is a great language to start programming with

New developers often ask what language they should learn first.

JavaScript isn’t necessarily the right choice for everyone - the right choice is really the one that you are most interested in. As much as you can energize yourself to get into the weeds. Two thoughts: follow your energy, and focus on finishing.

Inevitably I am pressed for a real answer. I always recommend JavaScript.

Reasons:

  • Wide applicability: JavaScript can be used to accomplish most of the things you’ll want to build: (websites, mobile apps, games). Many businesses run on JavaScript - you can easily build your whole career on it. And if you want to be developer, you will only benefit from knowing it.
  • Low(er) barrier to entry: JavaScript is a relatively more forgiving language to learn, and you don’t need to install anything to get started: you already have a browser! (unless you’re reading this with some other crazy voodoo… hey, how’d you get in there?!)
  • Tons of (free!) resources via a HUGE community: This lets you learn at your pace, and promises that help if you need it. Though I’ll tell you right now, the best advice you’ll get: “read the source!” of whatever tool you’re using. The sooner you start there, the sooner you’ll actually know what’s going on.

Use the Source, Luke

If you’re looking for ‘the source’ for Javascript, a great place to start reading is Eloquent JavaScript. It’s not light, but is a great place to start understanding JavaScript and it’s place in the programming universe.

Let’s get into these reasons a bit.

Is JavaScript easy (easier) to learn?

Programming Languages are trending toward ease-of-use, which makes the argument for JavaScript as easier-to-learn trickier now than it used to be. New languages are on the horizon!

Couple that with all the tools required to run a fully-fledged JavaScript app these days, and this argument can go either way.

An aside to explain that a bit more

The size of the JavaScript Community can sometimes be a double edged-sword; while it is wonderful to have so many tools to make our lives easier, it also means keeping up with it is constantly learning what all the new tools are.

The benefit for you, young padawan, is that because the community moves so fast, you are never far behind. JavaScript is as easy as hopping on the track and jogging with everyone else for a while - soon enough you’re caught up with everyone.

Soon after that, you’ll realize that the framework you just spent 3 months learning has become ‘old’, and the whole thing is sham. When you get over that, you’ll realize we’re all just trying to get data into the browser and see what the users do with it. So it’s no big deal, just keep trekking along.

JavaScript is less painful up-front

Running JavaScript on your own computer requires nothing more than the browser you are reading this blog post in.

In fact, you can open the Developer Tools of your browser right now and write some JavaScript right there if you want to. (TODO: link to post walking through this process!)

That feels like a pretty low barrier to entry - whether or not you would-be-dev readers will be brave enough to try it RIGHT NOW is another question.

There are more reasons why I think JavaScript is easier to learn, but that I won’t get into the details of in this post. Specifically, JavaScript is a dynamically typed language and an interpreted/scripted language. As the posts on those topics come together, I’ll update the links here for those willing to brave it. For now, Wikipedia, StackOverflow, Quora, etc. You know, the Internet.


It’s a jungle out there

When you get out there in the real JavaScript world, you’re gonna see just how full of it I am, presenting all this hunky-dory JS is easy crap, telling you it’s all fun and games.

It’s not all fun and games! Learning to program is a giant pain in the ass, and even though I love it, every day of work is dealing with things are truly a giant pain in the ass!

You’re going to find out that JavaScript is a state of ridiculous fragmentation (but how could a large community not be fragmented, really?).

That modern JavaScript is more or less a ‘complied’ language (so to speak) depending on which ‘future’ (ECMA) version you want (the latest, I promise).

That tools called ‘Babel’ are trying to help but that we really don’t need them now that NodeJS has gotten it’s act back together.

Once you move on to some other languages with features like type systems, you’ll learn just how much JavaScript may have been lacking all this time.

All of that might be gibberish to you, and don’t worry! Things are always getting better, and this stuff only starts to make sense once you start exposing yourself to it.

Programming is one of the most rewarding things you can do. Finding solutions to difficult problems, having that eureka moment when something finally works - if you enjoy those moments, you will enjoy writing code.

Things not to be afraid of

My biggest goal with this post is to provide a starting point for someone looking for a broad place to dive into JavaScript head first, and to quell fears of the brutal size of the JS community. I also tried to avoid tossing out gibberish keywords all over the place, which is definitely a difficulty of learning this stuff. The JavaScript world has MANY tools and phrases and keywords, and is totally overwhelming.

Don’t be afraid! The details will only sink in if you keep swimming in them. My friend and mentor told me early on that the articles I read on the web that I understand the least, the ones that that introduced the most new ideas - those are the really valuable moments in your growth. Disgesting new information starts with familiarizing yourself with the new lingo.

To that end, I’m pulling together a list of potentially off-putting WTF terms that you may come across in your travels. If you see any that you’d like a little background on, or that you would have liked to have seen in this context, please drop me a line and we’ll add a TL;DR to aid the next traveler.

  • JSON: JavaScript Object Notation is a structure for handling data. These days, when you move data between the browser and a server, you do it as JSON.
  • HTTP: Hypertext Transfer Protocol is one way that computers communicate with each other, and the most common method for modern web applications.
  • NodeJS/Node: This is a framework for writing backend applications in JavaScript.
  • npmjs/npm: A tool built into NodeJS, NPM stands for Node Package Manager and is used to download javascript libraries from the world!
  • Angular/React/Ember/Backbone: These are front-end JavaScript frameworks used to create large-scale web applications. If you are working on the front-end, you will definitely be working with at least one of these.
  • SPA/Single Page Application: An SPA is just another word for a web application - it is referred to as ‘single page’ because you can access many different ‘views’ without the url changing. Ex: Facebook’s homepage (and Facebook in general). I don’t like this term because I don’t find it useful… I always think, what’s the difference really, and there’s not much to know there. I don’t know if I’ve ever heard anyone actually use it. Nevertheless, you see it often enough, so here it is.
  • Tooling!: Babel, Gulp, Grunt, Brunch, and on and on. JavaScript has tons of libraries that exist for the sole purpose of making it easier to write more JavaScript. Features like live-reload (automatically refreshes your browser for you when you save your code file) will dramatically speed up the time it takes you get your work done.
  • Library/Framework: These terms refer to projects that you can use to build more things. Coding projects fit together like legos, and our libraries and frameworks make it possible to do alot more with alot less. A Library is typically smaller than a Framework, and less demanding. You would use a library to get a utility task done (like encrypting a password), while a framework would ask you to write your code in a structured way to work properly (like structuring a web application in ReactJS).

Soldier on!

If you’ve made it this far, you’re a trooper. I hope this has done you some good!

I’d like to end this with a list of resources and next steps, but as I haven’t put that together yet, for now you’re gonna get these tidbits.

For those who learn by doing, there are tools like codecademy and freecodecamp (and many more) that will help you get some quick practice in.

If you want to learn JavaScript, the language, I recommend Eloquent JS (mentioned above as well).

If you want to get started on your own website, I’m working some blog posts toward guides like that, but don’t expect to do too many - there are just so many already.

Please reach out or leave a comment if you have any ideas for how this could be more helpful!


Tetris, Elm, and Love for the Game

TL;DR: Was reading some Elm, found a tetris remake with a file that make me smile


A quick shout out to @jcollard for the code style in this file (link to source below):

module Tetromino where

import Location (..)
import Util

-- A Tetromino is a list of Locations. By definition, a valid tetromino
-- should contain exactly 4 different locations
type Tetromino = [Location]

-- A line piece
-- ****
line : Tetromino
line = [(0,0), (1,0), (2,0), (3,0)]

-- A square piece
-- **
-- **
square : Tetromino
square = [(0,0), (1,0),
          (0,1), (1,1)]
-- A Z piece
-- **
--  **
zpiece : Tetromino
zpiece = [(0,0), (1,0),
                 (1,1), (2,1)]
-- An S piece
--  **
-- **
spiece : Tetromino
spiece = [       (1,0), (2,0),
          (0,1), (1,1)]

-- A J piece
--  *
--  *
-- **
jpiece : Tetromino
jpiece = [       (1,0),
                 (1,1),
          (0,2), (1,2)]

-- An L piece
-- *
-- *
-- **
lpiece : Tetromino
lpiece = [(0,0),
          (0,1),
          (0,2), (1,2)]

-- A T piece
-- ***
--  *
tpiece : Tetromino
tpiece = [(0,0), (1,0), (2,0),
                 (1,1)]

Original source file.

The comments are one thing, but that’s some some serious love for the game when the code is shaped like the pieces.

Golang gotcha: `defer` zealot

TL;DR: Golang’s defer and sync.WaitGroups go hand in hand, but hit me with a conceptual gotcha this week.

Beware those for{select}s! Read on for details.


Got hit by a bug this week - I’m documenting it to inscribe it more strongly into my memory.

See if you can spot the issue:

// Worker should call f.pendingDownloads.Done() when each file is finished downloading + unzipping
func (f *FileManager) startDownloadWorker(downloadQueue <-chan downloadReq, abort chan struct{}) {
  for {
    select {
    case download, ok := <-downloadQueue: if !ok {
      // exit when no downloads left
      return
    }
    // call done when finished with file
    defer f.pendingDownloads.Done()
    var (
      baseName = filepath.Base(download.url)
      localDir = fmt.Sprintf("%s/%s", f.cfg.TempDir, download.subDir)
      localPath = fmt.Sprintf("%s/%s", localDir, baseName)
    )
    f.downloadFile(download.url, localPath)
    f.unzipFile(localPath, localDir)
    }
  }
}

That defer won’t fire until all the downloads are done! It waits until the end of the function, which won’t occur until the for{} exits.

Corrected:

// Worker should call f.pendingDownloads.Done() when each file is finished downloading + unzipping
func (f *FileManager) startDownloadWorker(downloadQueue <-chan downloadReq, abort chan struct{}) {
  for {
    select {
    case download, ok := <-downloadQueue: if !ok {
      // exit when no downloads left
      return
    }
    var (
      baseName = filepath.Base(download.url)
      localDir = fmt.Sprintf("%s/%s", f.cfg.TempDir, download.subDir)
      localPath = fmt.Sprintf("%s/%s", localDir, baseName)
    )
    f.downloadFile(download.url, localPath)
    f.unzipFile(localPath, localDir)
    // call done when finished with file
    f.pendingDownloads.Done()
    }
  }
}

It always seems obvious enough after the fact. What dug me in was the happiness of defer. I love being able to keep higher level knowledge closer to the top of code blocks, rather than tucked away at the end - calling f.pendingDownloads.Done() is definitely conceptually closer to the function’s usage than it’s implementation. This one was a doozy for several minutes though.

defer is wonderful, but don’t be a Zealot!

Updating Protobuf and GRPC in Golang

TL;DR: When protobuf updates, all the .protos and deps need to update.

This post is a quick-lookup for how to do that so I’m not googling it every time.


Go Dependencies

Update your relevant go dependencies:

go get -u github.com/golang/protobuf/{proto,protoc-gen-go} && \
go get -u google.golang.org/grpc

Update Protoc

Then (or before) download and install the latest protoc binary: github.com/google/protobuf/releases.

Download the zip, open it, and move the protoc executable file into somewhere on your path.

mv ~/Downloads/protoc-3.0.0-beta-3.1-osx-x86_64/protoc /usr/local

Rebuild where necessary

Rebuild your .protoc files, likely per project.

For me, this means running go generate ./... in each go project’s root directory.

GROK: Haxl from Facebook

Two here that are close enough to the same: a github repo and an article on its origins

GROK: Open-sourcing Haxl: A library for Haskell

GROK: facebook/Haxl (github repo)

Goal

Lately I’m interested in separation of concerns at the app level, specifically distinguishing task/instruction implementation from a domain-specific compiler for optimizing batches of those operations (grouping requests, rate-limiting, etc). This is especially useful in a functional programming mindset because of the typical emphasis on defining stateless functions.

Facebook has proved itself to be a powerful engineering force (GraphQL, React, etc.). I’ve been quite impressed with the literature Facebook’s engineering provides around its projects as well. I’m pushing the functional stuff for myself lately (Haskell, Elm). So this seems like a great project to explore.

Resource

Media Outlet

code.facebook.com (facebook dev blog), published June 10, 2014

Authors:

  • Simon Marlow
  • Jon Purdy

Discovered:

I found a reference to this while looking up a Github issue for graphql. I was actually looking for information related to merging graphql schemas. Found and pocketed this along the way. Issue link.

Offload

Haxl

  • layer between application code and ‘data sources’
can automatically:
- group multiple requests into a single one
- concurrently request data from multiple
- cache previous requests
  • benefit: sep of concerns: moving optimization out of the application logic
accomplished via:
- implicit concurrency via Applicative functors
- implicit caching means soundness and modularity for free

Implicit Concurrency

  • numCommonFriends x y = length <$> (intersect <$> friendsOf x <*> friendsOf y)
    • <*> allows for concurrent function application

Implicit Caching

  • soundness - ensures that changing resources behind the haxl layer don’t lead to unpredictable results
  • modularity - call sites don’t need to know anything about how other call sites work

Kickers

  • TODO: put together/link well-written FB Tech posts
  • TODO: pursue Simon Marlow, Jon Purdy for background, other tech writing, github projects
  • TODO: Read source for Haxl
    • learn how soundness is ensured
  • TODO: handful of haskell concepts to read about/understand

GROK: How Did Consciousness Evolve?

GROK: How Did Consciousness Evolve?

Goal

I read biology/psychology related stuff to keep up with human behavior from a science perspective - it is useful for:

  • creative fodder for sci-fi
  • looking for tech angles on culture and mental health
  • finding paradigms to create characters/models for story building

That being said, my goals in those areas are loose - a tighter one for this piece would be: think about the consciousness of a fictional character - how developed can it be?

Resource

Author: Michael Graziano

Published: The Atlantic

Discovered through: Emergent Future (Blog of Algorithma) post

Offload

Concept: Evolution as the grand unifying theory of biology

Consciousness’s history of understanding has been primarily: philosophy, cognitive science, religion

What is the adaptive value of consciousness? When did it evolve, what animals have it?

Concept: Attention Schema Theory

  • less than 5 years old
  • states: the brain evolved increasingly sophisticated mechanisms for deeply processing a few select signals at the expense of others, and consciouness is the ultimate result of that evolution

Selective Signal Enhancement

  • computing trick: competition
  • nerves shout for attention, only a few are heard
  • SSE: 700-600 million years ago
  • arthropod eye - selects visual edges, supresses the rest
  • primitive - doesn’t require a central brain, easily decentralized

Tectum

  • “roof” in latin
  • central controller for coordinating senses
  • coordinates overt attention
  • all vertebrates have one
  • constructs internal model for predictions and planning of movement and input

Wulst

  • brain structure, ~350-300 million years ago, reptiles, birds, mammals
  • in humans - became cerebral cortex - is massive, by far largest structure in human brain
  • reptiles, probably smarter than we give them credit for

Cortex

  • upgraded tectum
  • can react variably to variable input (look toward, look away, store in memory, etc.)

Tectum is master of overt attention; cortex adds ‘covert attention’ - moves deep processing from one item to another

The cortex constructs it’s own internal model

  • a very abstract set of info for what covert attention is doing, and what it’s consequences are (i.e. machine learning)

Opportunism

  • Teddy Roosevelt: “Do what you can, with what you have, where you are”
  • open minded, optimistic

Social prediction

  • one’s self model beocmes a model used to guess at others

Concept: Theory of Mind

  • ability to understand the contents of another’s mind
  • humans, apes, dogs, crows, crocs (care for their young)

Language

  • a big leap, at least 70k years ago

Evolutionarily

  • we’re hyper tuned to tap into eachother’s mind states - that’s our adaptive edge
  • Side effects: False postivies: Ghosts
    • [Religion as a healthy, encouraged false-positive for consciousness?]

Kicker

  • TODO: send to Brooke re: Veganism
  • TODO: further reading: bio of Francis Crick
  • TODO: Michael Graziano bio
  • TODO: Rough research of The Atlantic and it’s goals/agendas
  • TODO: Justin Barrett - Hyperactive Agency Detection Device (HADD)
  • TODO: Consider/research an AST model for character building (The Sims as a model?)
  • TODO: write Triage character bios with this in mind

Fast App/Window Control

TL;DR:

  • command + tab: Rotate through open apps (+ shift to reverse the direction)
  • command + ~: Rotate between the current app’s windows (+ shift to reverse the direction)
  • command + h: Hide the current application
  • command + w: Close the current window
  • command + q: Quit the current app.

If you’re power hungry:

  • BetterSnapTool: Windows-7 style resizing contro
  • Slate or HammerSpoon: for scripting the commands of your dreams dream-come-true commands customizing to the nth degree via scripts

Multi-tasking? Single task, but still Multi-Apping.

Moving between apps is a huge pain point of a productive workflow. There’s just not much real estate, and only one plane to show it on.

Key to the short-cuts listed here is understanding the current context, that is, what app are you currently ‘in’. The current app is always the one listed by name in the upper left (next to the Apple logo).

This is true regardless of what window appears to be on top of the screen. Be wary of this! Sometimes you can unwittingly Quit the wrong app entirely!

Command + Tab = your new bfff.

Right now:

  1. Hold Command
  2. Press Tab
  3. Don’t let go of Command

You’ll see a happy little list of icons before you, and notably, the second icon is selected.

These are your open applications, in the order of your most recent use of them. Whichever of these is selected when you let go of command becomes the app currently in focus.

  • You can move between these by tapping Tab repeatedly.
  • You can reverse the direction by holding Shift while pressing Tab.
  • You can even just mouse over one and release command to move to that app.

If the app is another space, or full-screen mode, you’ll move moved to that location (as long as the app has an open window).

Pro tips:

  • You don’t have to wait for the icons to show up - a quick Command + Tab + release will toggle you quickly between the top two applications.
  • You can even use this while you’re drag + dropping a file from/to your desktop, between Finder windows, or between supported applications.

Command + ~ (tilda)

If you have many windows open for the same application, command + ~ (reverse with shift) will rotate those windows to the top of the stack.

Quite useful if you want to break your chrome tabs out into different buckets.

Hide: Command + h

This hides the current application from view (including Mission Control!). Great for dropping Messages or Slack into the abyss when your boss is behind you.

Don’t worry, you can easily restore it with Command + Tab and selecting it. Like it was never gone.

Quitting isn’t for Closers

  • command + w: Close will close a window without closing the app. (Think w for “Window”
  • command + q: Quit will close all the windows and exit the app, hopefully with a warning, but usually not.

Powerups

  • BetterSnapTool: I used this endlessly until I moved to HammerSpoon (see below). Drag to any side/corner to smart-resize, and configure however you’d like. Lately I’ve set control + shift + Arrow left (or right) to move the application to that half of the monitor.
  • Slate or HammerSpoon: These requires writing your own config file, definitely recommend if you’re willing to get into the weeds - reach out and i’m write a guide for each! My HammerSpoon config can be found here.

Option-click-ftw

TL;DR:

Rather than a plan click and drag, if you hold option, it will create a copy of the file rather than move the original.


I didn’t know i needed it!

Use-cases:

  • Copying a folder with a project or application to start a new one based on the old
  • Creating a sharable album of photos without deconstructing the original
  • Simple version control: option + drag and drop to create a quick copy anywhere

Don’t forget you can click and drag across Hot Corners, while using Gestures, or while fast-app-switching

Spaces: The Infinite Frontier

TL;DR:

Spaces are a built in mechanism for keeping your application windows in separate buckets.

For example, one space could hold your social messaging apps/tabs while another holds your work-related apps.

Control over them stems from Mission Control, and is configured via System Preferences > Mission Control.


Get a handle on them

Crucial to taking advantage of spaces is getting a handle on Gestures, and then the available features in Mission Control.

Build-a-space:

  1. Three-finger swipe up to open Mission Control
  2. Click and hold on an Application (A Chrome window, for example)
  3. Drag to:
    • An already-open Space
    • To the upper right-hand corner to create a new one
    • To the right of an existing space, to create a full-screen App
  • Mission Control and clicks for days
  • 3 and 4 Finger swipes to slide back and forth between them

Handy features

To Delete a space:

  1. Open Mission Control
  2. Move mouse up to spaces
  3. Wait for the little X to appear in the upper left of a space
  4. Click it or ticket.

Who needs a Dashboard?

The Dashboard might be useful to some people…

If you want to disable it as a space, play with the Dashboard setting in System Preferences > Mission Control.

Those trackpad gestures tho

TL;DR:

Gestures are clutch for quickly navigating on your mac. (Assuming you use a trackpad)

Examples:

  • Swipe between Full-Screen Apps and Spaces: 3 or 4 finger horizontal swipe
  • Show all Apps + Spaces (Mission Control): 3 or 4 fingers up
  • ‘Forward/Back’ in the browser: 2 or 3 finger swipes left or right (See note below)

Just like hitting a hot corner with your mouse, executing a gesture fires an interaction. They can be a bit tricky to get the hang of at first, but one day you’ll be in flow and surprise yourself with how naturally you attempt it.

If you didn’t skip the tutorial when you first started up your latest OS, you were probably walked through a number of them, and then left on the Trackpad or Mouse configuration screen in System Preferences.

Own your workflow! You can configure these gestures to do your bidding! I recommend reading through all the options in there to get an idea of what is available, and playing with all of them.

I’ll comment on a few of them here; this is not comprehensive!

Trackpad

Point & Click

  • Tap to click: I usually disable this; otherwise my twitchy fingers do it all the time
  • Secondary click: A big deal when first switching to Mac from Windows (you can also hold control when you click)

Scroll & Zoom

  • Scroll Direction: This was a point of contention when Apple reversed the default here - it’s the first thing you notice when you sit down at someone else’s computer. I prefer ‘Natural’

More Gestures

  • Swipe between pages: Until recently, I’d always disabled this feature: it used to happen accidentally while scrolling down, which was infuriating. I defaulted to hitting Backspace to go back for years, and that still works great, but is too much wrist movement for my liking. Playing with it recently, I’m much more satisfied - the sensors have massively improved, or maybe I’m more precise now. Either way, I like it, and wanted it back; however, it was a pain to get it working again, see below if you’re interested in the details
  • Swipe between full-screen apps: I love this feature because I love using apps in full-screen mode (I find non-fullscreen apps to be difficult to cope with, attention-wise)
  • Notification Center: Most common use-case for me: opening this up to disable notifications for 24 hours
  • Mission Control: Swipe up to show all your apps - from here you can easily drag an app to a new space.
  • Show Desktop: For when your Hot Corner is all the way up there

Mouse

There are definitely mouse commands that you should have your way with. Just none that I use. #mouseless #noresearch

Aside featuring a Terminal command: Swiping forward and back isn’t working?

Most Googling pointed me to pages telling me to change settings in System Preferences > Mouse, but because I don’t have a Mouse, System Preferences refused to load those settings.

Luckily I found these instructions for disabling it and switched the FALSE to a TRUE, and after firing this command into Terminal, all is well again.

This immediately worked for me in a new Chrome window. Notably, I’d also already tweaked the setting to my liking in System Preferences > Trackpad > More Gestures.

To run the command, open a Terminal session, copy and paste this line, and then take the leap: tap ENTER to fire it, and update your defaults settings the manual way.

defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool TRUE

For a brief bit of detail, defaults is a program you can run in the terminal to update system settings - it’s the same thing that using System Preferences will use after you click on the buttons in there. The above command has access to more than just the bits in the menu presented by Apple. This one writes to a plist (aka ‘Preference List’), and sets the appropriate SwipeNavigationWithScrolls value to whatever -bool VAL you pass in.

If all this tickles your fancy and you’re interested in more, run defaults --help for more background on how defaults works - but fair warning, using unfamiliar commands can lead to difficult-to-restore situations! Don’t dive into the rabbit hole unless you’re willing to crawl all the way back out, covered in mud and WTFs.

Gest in jest

If you want more control or prefer to keep your hands on the keyboard, there are phenomenal options out there, all of which require a bit of digging and maybe writing a script or two.

For now, just enough to get you stated:

  • BetterSnapTool: Lets you drag a window to a border or corner for smart-resizing (aka Windows 7 UI)
  • HammerSpoon or Slate let you write a config script to handle your own hot-keys - definitely intended for a hacker mindset - if you have any interest, reach out! I’m happy to write up a getting-started guide or help you get going.

Hot damn, hot corners!

TL;DR:

Hot Corners are a feature of OSX that let you easily move between open windows, apps, and your desktop.

Hot Corners are clutch in a few specific scenarios:

  • Desktop Toggle: A full window app (Chrome, Finder) asks you to drag-drop a file from your computer to the page, and the file is on your desktop
  • Expos-say/All windows Toggle: You want quickly move to another app you have open, but can’t find the window

How to Enable

  1. Open System Preferences
  2. Click Mission Control in the top row
  3. Click Hot Corners… on the bottom left

A small menu will drop down, with four select menus, one for each corner.

To find your bearings, a quick test:

  • Click the drop-down for the top-right corner
  • Select Desktop from the drop-down list.
  • Now move your mouse into the top right corner of your computer screen

If you found your way back here, congratulations! Now we can behind the backs of everyone who didn’t.

Toggle that desktop!

The Desktop Hot Corner will show your desktop, or take you back to wherever you just were when you touch it. This is also my favorite Hot Corner usage - especially when you add in that you can use Hot Corners while you’re clicking-and-dragging files around, which makes it easy to drag files to and from your desktop in between other apps.

There are a few other Hot Corner options:

  • Application Windows: will show a nicely spaced view of all windows open for your current application
  • Mission Control: a nice way to show all your running apps, for fast-app switching

Both of these are helpful when clicking-and-dragging, as we are want to do.

Pro-tip: You can also switch between Apps with command + Tab, and windows with command + ~ (Tilda).

Docker is powerful - a quick overview

TL;DR:

I have only minimal sys-admin experience, but was able to get a cluster of Docker containers running without too much trouble.

Docker (plus Docker-Machine and Docker-Compose), Consul, and Registrator are a sweet suite of tools for maintaining your app in the cloud.

The Dockerfile is an awesome, unified abstraction that exposes the definition of a container.


What the derp is Docker?

Docker is a platform for running apps on any computer. It’s a binary that you install wherever you want to run your apps, and once installed, you can install “containers” defined by Dockerfiles.

These containers can interact in a number of ways, depending on what you want to do.

My experience is predominantly web-dev, so I wanted to run a Node app that touched RethinkDB, Redis, and a front-end AngularJS app.

You can do all these things without Docker, right? Sure, you can lean on Heroku and plugins, or you could script out and install all these things yourself on your own machine somewhere. And it’d probably work great.

Dockerfiles rock.

The advantage of Docker is the Dockerfile – in one place, you define the exact spec for one of your containers.

That file can be used to build the container from scratch, and it’ll run the same in every build, whether your app is in Dev, Staging, or Production.

This is great for aligning the environment your app runs in, but it also implies something powerful: container throw-away and rebuild is super cheap and super clean. Should something go awry on your system, you can easily remove and rebuild any and all of it.

This is pretty useful if you’re like me, trying to figure out how to get this black-box cloud computer to listen to my commands.

Also, coming from a sheltered Heroku up-bringing, being able to read Dockerfiles is an awesome way to learn how these systems are composed.

So, Dockerfiles for my system:

Much thanks to the Dockerfile Project for pulling together an awesome set of resources.

Some tools of the Docker trade

If you’d like to dive into Docker, I highly recommend going through the entire User Guide.

Docker provides a CLI, and recently launched a few tools that make it even easier to work with.

Docker Machine

Docker Machine is a CLI for interacting with machines you are running Docker on, be it virtual machines on your own computer or machines off in the clouds.

Creating a new, Docker-running machine is as easy as:

docker-machine create --driver virtualbox dev

Docker Compose

Docker Compose is a nice, version-controlled way to handle your docker run commands and improve your logging/debugging workflow.

This lets you control and log a slew of containers at once with commands like docker-compose up and docker-compose logs, which is much more convenient than the drawn out flags and vars of long docker runs.

Consul + Registrator

Being new to this kind of development, there are still concepts that I’m wrapping my head around. Service Discovery is one of these, and Consul (plus a tool called Registrator) provides a nice solution for it.

The gist of Service Discovery in this context is that the containers we’re running on our machine(s) need to know how best to communicate. Our Node container needs to know what ports to send data to the RethinkDB container on.

If you’re running on one machine, something like Consul + Registrator may be overkill. But if you’re not - Consul does some very cool things.

For example, Failure Detection. If we’re running a cluster of RethinkDB containers, and one of these containers kicks the bucket, Failure Detection allows Consul to no longer direct requests to that container, with minimal work on our part (essentially just defining a ‘Failure’ for that container).

Registrator is a service registry bridge - it automatically publishes/unpublishes the services your Docker containers expose.

If you’re only running on one machine and don’t want to get into this complexity, you’ll want to look into container linking.

Otherwise - my consul + registrator setup led to this current docker-compose file:

consul:
  image: progrium/consul
  command: -server -bootstrap -advertise 192.168.99.101
  ports:
    - "8300:8300"
    - "8301:8301"
    - "8301:8301/udp"
    - "8302:8302"
    - "8302:8302/udp"
    - "8400:8400"
    - "8500:8500"
    - "172.17.42.1:53:53/udp"
  dns:
    - 172.17.42.1
    - 8.8.8.8

registrator:
  image: gliderlabs/registrator
  command: consul://192.168.99.101:8500
  volumes:
    - /var/run/docker.sock:/tmp/docker.sock

I ran into a number of issues getting all of this running, but predominantly I needed to learn how all these things work together. I’m in a better place now, and will spare the post the details.

Feel free to reach out if you’re having trouble getting going, and I’ll try to help.

An aside: a Wordpress success story

Just a quick aside about the convenience of Docker.

A new contract came along, and I had to run Wordpress locally to do the work.

I’ve run Wordpress before, but it’s been a while, and I thought I’d have to face the details around Mamp/php/mysql/whatever. All of which is fine, but it’s a headache that isn’t really related to doing the work.

Docker to the rescue!

Here’s an awesome Wordpress Dockerfile. That plus Docker Machine lets you go from 0 to locally running Wordpress in just a few minutes, and lets you push up your own wordpress instance to any machine in the cloud in the same amount of time.

Beast mode

Going forward, I’d like to take on Docker Swarm. It’s a tool that makes it easy to control big swaths of containers all at once.

Aka, Beast mode.

Swift is sweet - Workflow and tools that pleasantly surprised me

TL;DR:

Vim in Xcode via XVim is crucial.

Alactraz is the essential Xcode plugin manager.

Some sweet libs you might like:

  • Bond is an interesting data-binding framework for Swift.
  • Alamofire is an awesome abstraction for all your HTTP.
  • SwiftyJSON because of course you’re using JSON.

NSHipster, objc.io, RayWenderlich are my most-used iOS learning resources.


Have you swifted lately? Swift 1.2 is officially out, which is good news: compiling is faster and more consistent, and we all know Xcode could crash less often.

I recently got back to building apps in iOS after a few years in browser-land, and was pleasantly surprised to find a number of tools that made my life easy.

This post is a quick look at a few of them.

Own your workflow!

Workflow is HUGE. Minimizing the cognitivie overhead of development has a direct impact on the quality of your work. Never settle for good-enough in your workflow - you’ll thank yourself for improvements immediately.

XVim

I’m a Vim addict, and getting back into iOS without it would be a tragedy. Luckily, I don’t have to!

XVim is an awesome, well-maintained plugin that gives you Vim super-powers in Xcode.

You can even write your own .xvimrc! Mine is here.

Alcatraz

Alcatraz is an awesome plug-in manager for Xcode. It’ll change your life!

Most plugins are fixes for things that should really be in Xcode already.

Some plugins that I like:

Don’t reinvent all the wheels

CocoaPods is a convenient package manager – and there are definitely useful open-source packages for iOS apps.

Bond, Swift Bond

Bond is a nice way to bind some data in your app to some fields in your app’s interface. It can dry up quite a bit of code in your view controllers, which means really good things for maintainability.

Alamofire

The successor to AFNetworking, Alamofire is a bad-ass little networking lib that will make your http usage easy-peasy.

Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"])
  .response { (request, response, data, error) in
              println(request)
              println(response)
              println(error)
            }

SwiftyJSON

Swift has great type safety; however, one side-effect of its implementation makes for nasty JSON unwrapping.

Enter SwiftyJSON.

Resources

It’s a great time to be an iOS dev! Xcode isn’t as bad as I remember it, and Swift is a really nice language to work with.

For more info, my favorite iOS dev related resources:

What I am using AWS Lambda for

TL;DR:

I’ve got a few AWS Lambda functions in production, composed with a handful of components I’ve grouped under the name Lambduh.

Shortlist of production lambda functions:


Lambda is powerful

Lambda is a new tool in Amazon’s suite of web services.

Each Lambda function runs on a fresh machine and can be handed any bit of data - and you only pay for that machine’s uptime, which at present is limited to 60 seconds.

Lambda recently added a slew of new features as it exited beta and offically launched. My experience as of writing this is limited to interactions with S3 events and invoking these functions via the AWS SDK.

Separation of Concerns is huge for simplifying your codebase. Lambda lets you define a function without needing to maintain any of the infrastructure. That’s a big deal, especially when it means any Lambda function you write is already scalable.

The achitecture resulting from using Lambda is functional in design - for me Lambda (and microservices in general) feel like a functional language pattern applied at the architectural level.

What am I using it for?

Any task that you can isolate from your server is a good candidate for a Lambda function.

In some recent consulting work (for The Bosco), I used Lambda to do some lazy file conversions and to automate the creation of a timelapse video.

Lazy, async file conversion

Let’s say you have a .gif you’d like to save to S3. Easy enough - just upload it.

Overtime, you may want that .gif in various other sizes and formats. There are many ways to do this:

  • Process the files locally, then upload all of them
  • Run a task on your server that fetches, processes, reuploads

Not terrible options, but either way some work to do, some bandwidth or server-load overhead, and the continual knotting of server code or operational processes. Wouldn’t it be great if you could just upload one .gif and forget about it, and all your processing would magically run itself?

Lambda functions can be invoked as a result of an S3 Put event, which gives us an elegant solution: Run a Lambda function to automatically process any .gif that hits S3.

gif-to-mp4 is a Lambda function that converts an uploaded gif into an mp4, then uploads that mp4 to S3. It takes about 5 seconds to run, and we’ve seen zero fails.

One caveat: at this time, an S3 bucket can only fire events to one Lambda function.

That means you either (1) need to do all your work reacting to that event in one function, or (2) write a Lambda function that invokes other Lambda funcs based on the inital event. This isn’t too complicated, and I think it’s a better strategy long-term.

For an example of how to do this, the next section features a longer-running process (>60s) that connects several Lambda functions.

Create a timelapse

Another need for the Bosco - let’s take an arbitrary slew of gifs and string them into a mega timelapse with some music. Ideally, we’d upload the finished product to Vimeo for all the world to see.

Processing this is not trivial – at a certain point, too many gifs means the process is going to take more than 60 seconds (we also need to download them all, and upload a ~25mb video to vimeo).

The solution I found is covered by these functions:

create-timelapse is something of an orchestrator; it defines the interface for external consumers of this service, and it manages the flow of the whole process, invoking the other lambda functions when the time is right.

Accomplishing this is somewhat complicated because of Lambda’s 60 second limitation – create-timelapse gets it done by incrementing a timer and invoking itself again after 45 seconds. There is potential for more efficiency here, perhaps with an external data store, or something like AWS’s waitFor(). For now, waiting a predetermined number of seconds is good enough and keeps things simple.

The rest of the functions do exactly as they are named: converting files between various formats, applying watermarks, concatenating videos, and uploading to Vimeo.

Some notes:

  • We save a ton of time in file-to-png. It’s invoked for EVERY file that is passed, which means as many machines as Lambda will give us at a time. It’s pretty awesome to see 100 gifs converted to 400 pngs in < 10 seconds.
  • Another hurdle was building an mp4 out of 400+ images - it just took the ffmpeg binary too long. The solution here - run 50 pngs at a time in pngs-to-mp4, then string those mp4s together in mp4s-to-timelapse.
  • upload-to-vimeo was simple enough to earn it’s own function, but for some reason my upload requests would ECONNRESET out, especially for larger videos. Turns out, throwing a ton of memory at Lambda resolves this kind of thing by giving you more CPU to work with. I’m running this at 1024mb and 60s to ensure it works for larger videos.

#Some general lambda things

  • gif-to-mp4 has been very cheap to run (likely true for create-timelapse, data pending). Paying only for uptime is very convenient in this case.
  • Uploads/downloads between S3 and Lambda are very fast. That’s expected, but was a nice surprise – I was running functions locally, and grew worried b/c things were slow to download/upload. It was definitely an oversight on my part – working locally is dependent on your bandwidth and latency, and things will run differently in the cloud.
  • Lambda functions have very consistent results (just like functional programming!). We’ve seen zero failures on the gif-to-mp4, and I’m expecting the same for create-timelapse (which went into production this week).

#Lambduh

Between all these functions, there was plenty to DRY up. Lambduh was my strategy for doing so.

Lambduh is a set of components for common tasks in Lambda functions. The components so far:

The first thing - these functions are small! It’s likely you could just as easily build them into your function itself. I built it because it’s going to save me plenty of time across all these functions, so maybe it’ll save you some too.

I’ll call out lambda-execute and lambda-gulp:

  • lambda-execute makes it easy to run shell commands or a bash script, which may help you get your bearings in Lambda’s environment.
  • lambda-gulp gives you gulp zipload, which lets you define your Lambda function’s configuration in a lambda-config.js file, then easily create a new function or update your changes.

#So there’s a bunch of hooplah

Lambda had quite a few quirks when I first dove in. (See this Quora answer and this Stack Overflow response for specifics).

Many things have been resolved since then. Though the Lambda/CloudWatch interface still struggles, I’m not seeing any function caching issues, and I no longer need to move or chmod any binaries before running them.

For the right situation, Lambda can be very useful! AWS just added a couple new event sources, and you can invoke these functions anywhere you have your AWS Credentials.

Diving into PostgreSQL with node-postgres

###TL;DR:

A quick brain-dump following my first experience with running PostgreSQL. Related repo is on Github.


##Time for Postgres

I’m working on a new project that is begging for a DB smarter than MongoDB. I’ve never worked in SQL land, but know that I wanted joins and SQL experience, and I’ve heard good things about PostgreSQL.

So what’s the fuss all about? I’m not sure yet. This post is focused on how I got PostgreSQL running for the first time on my machine.

Caveat: My knowledge of PostgreSQL at the time of writing this is more or less limited to the contents of this post.

##Brew

I use homebrew to manage the majority of my dev tools, so PostgreSQL is no different.

brew install postgresql

##Get it running

Once installed, a number of guides I found seemed to want me to use initdb to create a new database. Don’t worry about this for now, we’ll install one later.

[Optional] PostgreSQL can be started automatically on login via launchctl or a gem called lunchy (some launchctrl context). I opted to not do this - I prefer to keep things manual, especially when working with a new piece of tech. One reason for this: I like to see the database logs as they happen, so I don’t get lost in a mess of background processes when something doesn’t seem to be working.

I added the following aliases to my zschrc:

# Postgres aliases
alias pg_start='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
alias pg_stop='pg_ctl -D /usr/local/var/postgres stop -s -m fast'

But again, to start, I’m going to be running PostgreSQL manually to see the live logging in my terminal window:

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

If it works, you’ll see something like this:

LOG:  database system was shut down at 2015-01-03 16:36:44 EST
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started

Hopefully this command works for you - if not, debug a bit, run some --help commands, or drop a line over Twitter and I can help troubleshoot.

##node-postgres

node-postgres is a node client for postgres. You can install it with npm install pg.

The maintainers provide an example node app that I used to jumpstart my Postgres usage. I grabbed and threw this into a repo. You can run the script from the project’s root with node script-name.js, in my case, node node-postgres-example.js.

Take a read through the script. For our getting-Postgres-running purposes, we’re mostly concerned with the conString being used.

var conString = "postgres://postgres:1234@localhost/postgres";

The triple use of “postgres” makes this a fun little puzzle, eh?

postgres:// is specifying the postgres protocol (the same way mongodb commands start with mongodb://). This should never change while you’re using postgres.

postgres:1234 specifies a username and password. We’ll create this user w/ password shortly.

@localhost/postgres specifies the host and then the name of the database you wish to connect to.

Recap:

var conString = "<protocol>://<username>:<password>@<host>/<databaseName>";

##Run that script!

If you haven’t already, get Postgres running and run that script via the node command. If you go to http://localhost:3001 in your browser, you’ll ping the server, and the script will try to connect to the db and insert an entry into a Table called ‘visits’.

At this point, this will fail for a few reasons, which we can walk through next.

##Run script, Ping browser, Read Error, Debug, Repeat

###FATAL: role “postgres” does not exist

The first error I saw was a double. The script failed with:

TypeError: Cannot read property 'query' of null

and Postgres reported:

FATAL:  role "postgres" does not exist

The node script is not well developed for non-postgres users - drop in plenty of console.logs to help yourself debug faster.

The important bit here is the Postgres error, which tells us we have no postgres user in the DB.

From here I went down a winding path. It seems you can create users a few ways, each with varying levels of security. I went for the easiest way - DO NOT assume this is a solid way to create postgres roles in a production database.

The psql command (psql docs) drops you into a PostgreSQL repl within a database of your choosing. Here we’re going to create a user account database, use psql to hop into it, then create a new user and database to play with.

createdb russellmatney
//or your own username - this name matched the
//`database [x] does not exist` err that shows if you run `psql` on it's own
psql
CREATE USER postgres_admin WITH PASSWORD '1234';
CREATE DATABASE postgres_db OWNER postgres_admin;

It’s odd to create a db in your own user name. At this point I believe this is a user-account database, which I’m taking to mean a database for storing users and giving us a place in our db cluster to work from.

Update your script’s conString with the new info:

var conString = "postgres://postgres_admin:1234@localhost/postgres_db";

Run it, ping it, and check your db/script output to see where we are.

###ERROR: relation “visit” does not exist at character 13

The next error I saw looked like this:

ERROR:  relation "visit" does not exist at character 13

Our “visit” table does not exist! Let’s psql into the database and create it.

psql postgres_db
CREATE TABLE visit (date date);

Don’t forget that semicolon!

Run + ping + check again.

###ERROR: permission denied for relation visit

The last thing I ran into here:

ERROR:  permission denied for relation visit

It seems our postgres_admin role does not have the adequate permissions to access the table we’ve created, despite being the owner of the database.

Useful commands within psql that helped me resolve this bug:

  • \du - lists the users and their priviledges
  • \list - lists the databases in the cluster and their owners
  • \dt - list the tables in the current database
  • \q - exit the repl

Spot the issue yet?

If you log into the postgres_db database and run \dt, you can see the visit table’s owner is not postgres_admin. We did not specify an owner when we created the table, so it defaulted to our logged in user (for me, that’s russellmatney).

A quick fix to get it working is to update conString to use your own username:

var conString = "postgres://russellmatney:1234@localhost/postgres_db";

But that’s not ideal. I suspect we could also DROP (SQL for delete) the table and recreate it using WITH OWNER postgres_admin.

But let’s touch on something else: Priviledges and the GRANT command. I found some reading here and it’s just what we need:

postgres_db=# GRANT ALL ON visit TO postgres_admin;

Refresh your browser, and you should be a happy camper! Watch your table grow and your visits tick up each time you refresh.

##Postgres Post Game

So we’re up and running! Next steps are wide open:

  • Explore PostgreSQL’s super powers
  • Toy with a handful of node clients
  • WTF is a join? Amirite?

##Some Resources:

PostgreSQL 9.4 docs:

  • I should probably have started here, but I never seem to have the patience to read the docs before trying it once.

How To Create, Remove, & Manage Tables in PostgreSQL on a Cloud Server:

  • I didn’t get into the rootuser su stuff, but it’s definitely related to the error in Table ownership that we hit
  • The rest of this article was helpful for the psql and SQL commands

##Good luck!

Reach out if you have trouble debugging any issues discussed, or if something could be better explained! @russmatney on Twitter.

Glorious E2E refactor via generators and co

###TL;DR:

I just refactored some E2E tests from a supertest implementation to one that uses generators via co-supertest (basically supertest wrapped with TJ’s co lib) for massive readability and therefore maintainability improvements.


##E2E testing is important and very useful, but can get messy

I love using e2e tests to get a project up and running. Once a few CRUD tests are in place, I’m free to play with whatever frameworks and architectures I want without fear of breaking any client-server contracts.

I recently built out a small API with ExpressJS, and included some E2E protection via supertest, a lib that makes testing HTTP request/response easy.

Basic E2E test with supertest:

it('should return a 200 and data on a get to /users', function(done) {
  request.get('/users')
    .expect(200)
    .expect(function(res) {
      if (!res.body.users) throw new Error('No users array or object on response body');
      if (res.body.users.length !== 0) throw new Error('Array should be empty');
    })
    .end(function(err, res){
      if (err)
        done(err);
      else
        done();
    });
});

The above example is fine. But, when you get to a slightly more complex use-case, the code quickly resembles the Pyramid of Doom. One example: Authentication e2e tests.

Short of fleshing that example out and for the sake of the length of this post, here’s the co-supertest implementation of the above example. Feast your eyes!

it('should return a 200 and data on a get to /users', function*() {
  var res = yield request.get('/users')
    .expect(200)
    .end();

  if (!res.body.users)
    throw new Error('No users array or object on response body');
  if (res.body.users.length !== 0)
    throw new Error('Array should be empty');
});

Much more pleasing to the eye. The use of yield lets us keep our functions a minimal number of layers deep, and eradicates ugly scoping issues that might crop up.

Testing does not have to be painful! Own your code base!

If you’re looking for any info on the implmentation of these tests, check out my Koa + Gulp + Supertest post

Let me know if this post could use some more in-depth examples, I’m happy to elaborate more! Reach out here or via Twitter (@russmatney).

Basic Koa API + Gulp + Supertest

###TL;DR:

A step-by-step walkthrough for building a Koa app, setting up a gulp dev environment, and getting a few endpoint-level tests covering your CRUD from the beginning.

All code in this post can be found on github. Note: Some code was modified during the writing of the post that has not yet been updated in the linked repo. Update to come soon.


##A bit on generators

JavaScript has a few new things coming in ECMA 6, one of which is a new kind of function called a generator. I hope to get into the details of how generators work in another post, but for now, you can recognize a generator by the * added to the function signature, and the use of a new keyword yield:

var doWork = function *() {
  console.log("I am a generator");
  var data = yield getData();
  console.log(data);
}

Generators allow functions to be broken into pieces that can run with more control than before. One big advantage is dealing with asynchronous control flow. In javascript and especially Node, we’re used to using the callback pattern or promises to wait for some async promise to run before moving on.

Generators simplify that – if handled properly, the above function will ‘yield’ when we hit getData(). Control flow will buzz along elsewhere, but eventually return the output of getData() to our data var and continue walking through doWork(). There are some details to getting this to work as described, but imagine how much cleaner a yield is than callbacks of doom or importing a promise library.

This is just one use of generators; for more details on what exactly is going on under the hood, I learned a ton from David Walsh’s series.

##co

Now we know generators can give us a new way to control async processes in our code. Sweet. So how do we implement them?

Rather than implement them from scratch, we’re going to climb up on the shoulders of giants and use some clever abstractions. TJ Holowaychuk’s co library lets us treat callbacks or promises as generators. (One example in the co docs).

I recommend looking at co and toying with it on your own. For the purposes of this post, I’m going to keep trucking towards Koa to try to keep things concise.

##Koa

co makes mixing generators and existing packages as easy as adding a wrapper. So what’s Koa?

You can think of KoaJS as a successor to ExpressJS, both in spirt and in maintainer. Koa is a framework for building Node apps that takes full advantages of generators. It’s super slim, and it makes some interesting design decisions to keep your code clean.

One of these design decisions is the use of what Koa calls ‘context’. Rather than the typical node fn(request, response){} signature, Koa combines the request and response into the context of the function. req.body now becomes this.body. res.query now becomes this.query.

You can check out the Koa docs for more info, but if you’re like me, this all means nothing until you’ve thrown an app or two together. Let’s dive in.

##Perfect Harmony

Using generators (and therefore co or koa) require a bit of setup – you need a version of Node that supports it (v0.11.x) and you need to use the --harmony flag to include the new ECMA 6 features.

I recommend using nvm to install and run the latest version of node. I’m using v0.11.11 to run this project.

The --harmony flag can be added to the end of any node command you run on the command line, but what we’ll do is add a ‘start’ script to our package.json, and just use npm start to make the magic happen.

##A lil baby Koa app

Let’s get our app up and running.

Here’s the code for a basic http server:

//server.js
var koa = require('koa');

var app = module.exports = koa(),
  port = process.env.PORT || 8000,
  env = process.env.NODE_ENV || 'development';

app.listen(port);
console.log('app listening on port: ', port);

If we try to run this with node server.js, you should see an error like SyntaxError: Unexpected token *. node --harmony server.js should run smoothly (displaying the console.log above). If you’re still seeing the same syntax error, make sure you’re running node v0.11.9 or higher. (Again, nvm is a great tool for managing your node version per project).

You can use the package.json’s scripts property to wrap up the start command for your app.

//package.json
"scripts": {
  "start": "node --harmony server.js"
}

At this point you should be able to run your app with npm start.

##Big Gulps, huh?

I’m a big fan of gulp – it’s a simple yet powerful task manager for any javascript app. We’re going to use it here to get some live-reload going to speed up or development.

npm i --save-dev gulp gulp-nodemon, then throw this in a gulpfile.js

//gulpfile.js
var gulp = require('gulp'),
  nodemon = require('gulp-nodemon');

gulp.task('nodemon', function() {
  nodemon({
    script: 'server.js',
    nodeArgs: ['--harmony']
  }).on('restart');
});

gulp.task('default', ['nodemon']);

You should now be able to run your app with gulp, and changes to any file should restart the server without an issue.

##Start your testing engines

I’m also a big fan of TDD, or at the very least, testing early and often. It’s important to get your testing environment setup early in any project – difficulty getting tests running is a terrible excuse for no tests.

We’re going to use mocha, chai, and co-supertest to set up an endpoint-level test.

npm i --save-dev gulp-mocha-co gulp-exit chai co-supertest supertest

//test/endpoint.js
var app = require('../server.js');
var request = require('co-supertest').agent(app.listen());
var expect = require('chai').expect;

describe('/ endpoint', function() {
  it('should return Hello, World', function *(){
    var res = yield request.get('/').expect(200).end();
    expect(res.text).to.equal('Hello, World');
  });
});

There are a few things going on here:

  • We’re using co-supertest as a wrapper over the supertest library to expect a 200 as the status code.
  • We’re using chai’s expect library to test the response text
  • Our test functions are actually generators! This lets us yield async responses without needing a callback or promise structure - we’ll use gulp-mocha-co to implement that.

Let’s get these tests failing! add this to your gulpfile:

//gulpfile.js
var mocha = require('gulp-mocha-co'),
  exit = require('gulp-exit');

gulp.task('test-once', function(){
  gulp.src(['test/*.js'])
    .pipe(mocha({
      reporter: 'nyan'
    }))
    .pipe(exit());
});

With all that in place, we should be good to go, right? Try gulp test-once and see what happens. That old Unexpected token * again, huh?

Because we’re using generators in our tests, we need our good-ole –harmony flag attached to our test command. We’ll update our package.json to solve this again.

//package.json
"scripts": {
  "test": "node --harmony `which gulp` test-once"
}

Now you can run your tests with npm start - you should have one failing. Let’s get it to pass!

##Your Just-Approved Endpoint

Koa itself is very slim - we’ll have to add some koa modules to get routes and logging working.

npm i --save koa-logger koa-route

//server.js
var logger = require('koa-logger'),
  route = require('koa-route');
...
app.use(logger());

app.use(route.get('/', function*() {
  this.body = "Hello, World";
}));

This should be enough to get your test passing! Run npm test to see it.

You should also see your app running in the browser, and routes logged wherever your server is running - run npm start and navigate to port 8000.

##Live Re-running tests

So far, here’s what we’ve got:

  • Koa server with routes and logging
  • Tests exercising one endpoint
  • Live-reload of code on file save

The next thing to add is live-reload for our tests. Whenever I save a file, I want to see what tests are passing or failing as soon as possible - the shorter that turn-around time is, the faster you’ll be able to improve your code.

We’re going to add a watch task to our gulpfile that will react to changes to specific files. We’re also going to refactor our test-once function to run the our simpler mocha task. test-once will exit after tests are run (good for CI purposes), while mocha will run repeatedly.

//gulpfile.js
gulp.task('watch', function() {
    gulp.watch(
      ['*.js', 'test/*.js'], //blurbs of files to watch
      ['mocha'] //tasks to run when the above files change
  );
});

gulp.task('mocha', function() {
  return gulp.src(['test/*.js'])
    .pipe(mocha({
      reporter: 'nyan'
    }));
});

gulp.task('test-once', function() {
  gulp.tasks.mocha.fn().pipe(exit());
});

gulp.task('default', ['nodemon', 'mocha', 'watch']);

Normally this would be enough – a simple gulp will start your server, run your tests, and restart both of those things on any file change. But we’re on the cutting edge of javascript here - and our tests are going to whine if our process doesn’t flag --harmony. We can fix that the same way as before - via the package.json.

Everything should run fine with the ‘node –harmony which gulp’ command, so that’s what we’ll drop into our package.json:

//package.json
"scripts": {
  "start": "node --harmony `which gulp`"
}

Now we can do it all with npm start.

##EADDRINUSE

Except what’s this error? E-ADDR-IN-USE?

EADDRINUSE pops up whenever a process wants to run on a PORT that’s already exposing a process. In our case, our app is running on port 8000 via Nodemon, and then supertest tries to run it again in our mocha tests.

One way to solve this problem is to specify a different PORT based on the environment. That’s probably the easiest solution at this point.

In our gulpfile, add a PORT to both the nodemon task and the mocha task.

gulp.task('nodemon', function() {
  nodemon({
    script: 'server.js',
    env: {PORT: 8000},
    nodeArgs: ['--harmony']
  }).on('restart');
})

gulp.task('mocha', function {
  process.env.PORT = 8001;
  return gulp.src([...])
    ....etc
});

That ought to do it. npm start should start your server and run your tests, and any save to js file should restart and re-run both.

##A healthy refactor

Now we’re in business. The rest of our work can be done while npm start is running, with blissful instant feedback bliss.

We are good developers! We write maintainable code! Let’s refactor our endpoint functions out of the server file.

//server.js
var endpoint = require('api/endpoint');
app.use(route.get('/', endpoint.show);

Create a new directory and file for our endpoint:

//api/endpoint.js
module.exports.show = function*() {
  this.body = "Hello, World";
}

Bada-bing, bada-boom, this code is refactored, and we know it’s still working great because our tests are passing.

##Lather, rinse, repeat.

The last thing we’ll do for now is add a new endpoint, starting of course with a test for it.

//test/endpoint.js

it('should create an object', function *() {
  var object = {ziggity: 'zap'};
  var res = yield request.post('/').send(object).expect(201).end();
  expect(res.body.created_at).to.exist;
  expect(res.body.ziggity).to.equal('zap');
});

Once your test fails, we can add the route and handler to our Koa app. Run npm i --save co-parse to handle the request body with ease.

//server.js
app.use(route.post('/', endpoint.create));

//api/endpoint.js
var parse = require('co-body');

module.exports.create = function*() {
  var object = yield parse(this);
  object.created_at = new Date;
  // TODO: save to DB
  this.status = 201;
  this.body = object;
}

We aren’t saving to the DB yet, but we are enforcing some parts of our interaction, such as setting the status and created_at date, as well as returning our ‘created’ object to the client.

##Next Steps

You’re off and running with a functional dev-env for building whatever Koa app you’d like. Congrats! In a future post, I’d love to get this app talking with an actual database (mongo or rethinkdb perhaps?). If you want to start in on that now, check out some of the other Koa examples.

Reach out to me in the comments below or on Twitter if you’ve got any questions.

Assorted brainy things related to being a human

##TL;DR:

It’s been a while; I have an assortment of things that I’m not sure what to do with. Here they all are pretty much at random.


###Including You

There was this awesome reading on Radiolab half a year ago, and it definitely deserves a listen. It’s by Jenny Hollowell and it starts about 3 and a half minutes in. It’s called “A History Of Everything, Including You”.

###Universal Inner Child

Check out this piece from BrainPickings on Ted Hughes and a letter he wrote his son. It’s dense, but worth it. My notes: Ted writes that we build a secondary self, as armor to cope with the world, and that our inner child never grows up, unless we let it. When that armor is pierced, we are scared, or angry, emotional in some way. Those times, that is when we grow.

###How to Stay Sane

Another Brain Picking. Philippa Perry tells us to be careful what stories we expose ourselves to:

If we do not have a mind used to hearing good news, we do not have the neural pathways to process such news.

That’s something to think about, what with all these dramatic headlines competing for clicks.

There’s a really great bit about optimism too:

I am not advocating the kind of optimism that means you blow all your savings on a horse running at a hundred to one; I am talking about being optimistic enough to sow some seeds in the hope that some of them will germinate and grow into flowers.

Sow some seeds!

###Derailed - Social Currency

A very honest piece about the cost of putting value into the emptiness of gamified social websites.

###As a Man Thinketh

One of my grandfather’s favorites, with some empowering arguments. You control your destiny and actions, at the very root of your thoughts and through the use of your time.

(Pending macro-economic influences, of course.)

###Such a Worry-Wart

I worry, but I also believe worrying doesn’t help much of anything. This post had a great piece of advice: set aside time for worrying, and do your worrying then. Maybe 15 minutes in the morning, and 15 more at night if you need it. Otherwise, forgeddabouttit.

###Some exposure to Paul Graham

From this post on what modern business can learn from open-source.

On “bloggers” as a “fad”:

Actually, the fad is the word “blog,” at least the way the print media now use it. What they mean by “blogger” is not someone who publishes in a weblog format, but anyone who publishes online. That’s going to become a problem as the Web becomes the default medium for publication. So I’d like to suggest an alternative word for someone who publishes online. How about “writer?”

Those in the print media who dismiss the writing online because of its low average quality are missing an important point: no one reads the average blog. In the old world of channels, it meant something to talk about average quality, because that’s what you were getting whether you liked it or not. But now you can read any writer you want. So the average quality of writing online isn’t what the print media are competing against. They’re competing against the best writing online.

How to be a tech super hero

###TL;DR:

A list of some ways to break through to the next level of your tech life.


If you talk to me about programming, you’ve heard me plug Uncle Bob’s talk on clean code and professionalism. To paraphrase: For the rest of the world, software is a black-box, and programmers are sorcerers that make things go, when clicked. This is awesome! But it implies some negatives: if something goes terribly wrong, the rest of the world will grab their torches and start up the witch-hunt. Something terrible will happen, and what will we have to say for ourselves?

Clean code and best-practices are pretty important. But how do we figure them out?

I’ve been programming full-time for a year and a half. Intro-to-JavaScript sites like Codecademy and CodeSchool are less and less valuable as you gain more experience. What I need now isn’t syntax or puzzles. I need big-picture architecture help. I need more experience with testing and documentation. I need advice around security issues. I need help with problems that need some back-and-forth to figure out. Where do I get that?

First of all, here’s a great talk I saw a while back about moving from intermediate towards expert in this field.

Below is a list of places I look for those answers now.

###Get a mentor

By far the most effective and efficient solution (as well as the most elusive). Working side by side with another developer is the best way to climb that initial learning curve (which, by the way, is a big one). The trouble, of course, is finding one. This could warrant a full post, but for now: go to Meetups and Coffeeshops and Hackathons and check out the rest of this list if you’re on the hunt. Once you’ve got a mentor, sink your teeth in and camp out under that learning tree.

###Be a mentor

You don’t have to be a so called “expert” in anything to pair-program through a new feature or bug. Engineering is just problem-solving. If you’re having trouble getting help on something, find someone working on a related task and help them out.

By the way, the best debugging advice I know is just learning to read error messages and the console output in general. It’s obtuse, but is a powerful, time-saving skill.

###Find a hacking buddy

At least once a week, work with someone in person, even if it’s on different projects. This blog is called Techsposure because it’s all about exposure to Tech; I believe exposure is the most important part of learning - understanding can come later, but you never get there without the first exposure.

###Meetups and Hackathons

If you’re lucky enough to be in a city with lots of tech Meetups, this is as easy as signing up and showing up. If not, you are completely free to start one!

Hackathons are a bit rarer. A little bit of googling can reveal the darndest things.

###Lightning Speeches!

I’m terrified of these and have never done one, but I KNOW it will be good for me and that it’s a great way to break into giving larger talks. Speaking of which…

###Give some talks!

Like blogging about something you just learned, but with higher stakes: more pressure and fear to get over, and a much greater reward.

###Networking!

It’s easy enough to trade twitter handles with people you meet. A strong network is very valuable, especially when there is so much demand for quality code. Remember, recruiting is very hard for both sides, and it’s always better to hire the right people at the wrong time than to be scrambling when you need lots of code in a hurry.

###Ask why and be opinionated

Forming an opinion about different parts of a system, language, or framework is crucial. Stay open-minded, but bringing your own ideas to the table (whatever level of experience) is the point. Anyone can write that code once the architecture is designed.

###Open-Source Contributing!

You don’t have to be in a big tech city to work with great people or on great projects. Dive into open-source everything! Check out this post I wrote for more on open-source stuff. Since writing that post, I found this, a great post on using documentation as an entry point to some awesome open-source projects.

###Write about it

StackOverflow is a believer in asking the rubber duck before asking anyone else for help. Defining or explaining your problem organizes your brain, and leads you to the answer.

Blogging or writing about something works the same magic. Go write a little something about a new piece of tech you just discovered, especially one you don’t fully understand. You’ll end up defining for yourself exactly what you know and don’t know, and deepen your understanding of the big picture.

Forget publishing and feedback and what the world thinks - this is for you. You are essentially mentoring yourself (and other lucky readers, if you publish it), and reaping the benefits of teaching that new material.

###Guest Blogging!

Same benefits as writing, with a larger audience. Most blogs are literally asking for it.

###Pro Tips!

Twitter, CoderWall, GeekList, etc. There are lots of places for very helpful little tid-bits.

###Book reading?

Some people like to read books on code - I haven’t had a ton of success with it yet. The exception to this for me will likely be an entrance to functional programming via Learn you a Haskell for Great Good.

###Online reading!

I love my email subscriptions and Pocket for reading offline. My reading workflow is basically filtering headlines via email and adding them to pocket, then reading as I have time. What blogs/email subscriptions, you ask? That warrants another post, but I’ve subscribed to most of the lists mentioned here.

Other people like RSS, which I’m told is awesome, but wouldn’t know.

###Keep that knife sharp!

As always, keep your workflow and your problem-solving skills sharp. Codewars, Project Euler, and CoderByte should be enough to get you started. Or, you can go for app-sized katas too, like this guy did with tic-tac-toe.


There you are, a list of plenty of online and offline ways to get that exposure. I should probably have mentioned Conferences too… and some of these deserve more specific examples… Anyway, you get the idea. No more excuses! Do it to it!

Writing is reporting

Saturday, on the A train. He got on around Canal or Chambers, and said his name was John Hennessy. His teeth were askew and he looked more like a Cargo Jeffries, but was quite well-spoken. He said he makes his living with his words and he’d appreciate anything we could give.

I couldn’t hear over the noise of the car, but I saw the words hit the people. Slowly at first, then some stirred. They looked around, like waking up. One raised her eyebrows, then there was a change in her eyes. After a time, her brain exploded.

Kata help you? Also, nodeschool.io and MMO Set.

TL;DR:


Ever heard of a kata? My first exposure was the TDD word-wrap function (and unicorns) to start this (amazing) talk from Uncle Bob (Demanding Professionalism). Another arcticle came up in my Pocket queue: Using Katas to Improve. Kata is a japanese term; my understanding is that a kata is repeatedly practicing the same techique in order to improve form.

In terms of code, then? Chong Kim (the above author) likes building tic-tac-toe in ruby. He built the game from scratch repeatedly, trying to get his time under an hour. He recorded himself and reviewed each one, analyzed the moments he got stuck and issues with his workflow. Over time he was able to round off the edges of his ruby workflow.

All of that, I love. I could see being very useful for becoming a master of your craft.

But then Chong took it further. He’d been interested in Haskell for a while, and decided to take his kata in a new language direction. From scratch, he dove into his tic-tac-toe from the Haskell perspective, learning the language, where he got stuck, where he needed a deeper understanding of the code. What a brave man.

Kata are an awesome way to stay goal-oriented and push yourself to be a better programmer. I recommend:

  • Codewars is built around katas, and have stuff for JavaScript, CoffeeScript, and Ruby. They even have a challenge before you can sign-up! Go prove your worth!
  • Project Euler has problems generic enough that you can tackle it with any language. Warning! These problems are hard!
  • You Can’t JavaScript Under Pressure is 5 problems while the clock is ticking. I hit something like 40 minutes on the first try (the last problem threw me for quite the loop), but brought it down to 6 minutes on the 2nd try. Also, check out the other usvsth3m games, it’s like discovering Sporcle all over again.
  • Rebuild a simple game or a basic to-do app. (Of note: ToDoMVC is the same ToDo App written in a handful of different frameworks)
  • Make up your own!

nodeschool.io has some awesome terminal-based NodeJS courses, all free and vim-able. I’ve been working with a few Node apps at work for 10 or so months, but these courses really kicked my ass. I highly recommend it to anyone who is just starting with or thinks they understand node. It’s great for understanding what node can do on a detail-level (as opposed to higher-level system architecture).


One last thing: last week in Vegas with Moveline, Mr. Gibbons and Ms. Edison hooked us all on Set, a pattern recognition game that I apparently suck at. On the flight back, I started an AngularJS version of the game, and am hoping to take up to MMO Set status via nodejs and socket.io (similar to this flippin’ awesome tutorial).

Feel free to fork/pull-request it as you will, it could use some love.

Open (Source) Sesame

TL;DR:

Contributing to open-source makes you a better programmer, so just do it. If you don’t know what to do, start a streak and hold yourself to it. Soon you’ll be in the flow.


“Can I tell you something? Your Github profile kind of sucks.”

A friend of mine said this to me. I write code often! I push to github at least 5 days a week! Was he wrong? No. I only work with private repos.

My public profile sucks.

It’s difficult to break into open-source programming. I think I’m starting to crack the shell now. After bluntly insulting me, Ryan recommended what he called “The Github Challenge.” The goal is to contribute to something open-source every day, extending the streak shown on your github profile.

I’m at 12 days now, and will hit 13 today.

I have always wanted to push some helpful open-source somethings, but never known exactly what. Looking for at least one commit per day has been a good start. In that last 12 days, I’ve:

Sure, some of those days I just updated a Readme to better explain it, or found some other BS commit to keep the streak going. But I’ve also seen a spike in productivity and touched a variety of new tech.


Writing and contributing to open-source projects will make you a better programmer. Working in the open forces you to raise the bar for your own code. Contributing to larger projects is a great way to raise coding and testing standards. You’ll also get some experience building in a team environment.

Get involved in the direction of projects, form your own opinions, learn some best practices, and get exposure to what all this open-sourcey goodness is all about!

Another thing: when I’m looking at new-hires, I always look at their github profiles. I realize now it may have been hypocritical of me… but hopefully not for long. A slim profile doesn’t look bad, but when hiring, more information always helps confidence in a candidate.


Going forward, I have some loose goals. I’d like to contribute in some different languages (ruby, python, golang, haskell). I want to build a ruby gem, a jekyll plugin, a jquery plugin, a bower component, a javascript library. I use these pieces everyday but know so little about the anatomy of them, and building that grunt plugin definitely taught me some grunt and npm background that I should have had a few months ago.

An easy way to get involved and some good reading if you’re looking for more:

Dive in now, code-monkeys!

The Right Reasons

TL;DR:

Make sure you’re the “author of your own ambitions” by ignoring prestige and not needing approval.


Another great article from Brain Pickings: How to find your purpose and doing what you love. Below are some details I’ve gleaned from this and some related posts.

Paul Graham tells us that doing anything for prestige is generally not a good idea. “If it didn’t suck, then they wouldn’t have had to make it prestigious.” He says prestige pushes us from working on what we like into working on what we’d like to like.

A TED talk from Alain de Botton: A kinder, gentler philosophy of success. The whole thing is great, but my favorite part is his emphasis on making sure that the “success” we’re striving for is our own idea, not somebody else’s. It’s crucial to make sure we are the “authors of our own ambitions.”

Hugh MacLeod tells us the best way to get approval is not to need it. Nothing to add except that he’s right.

Denise Shekerjian tells us: “The trick to creativity, if there is a single useful thing to say about it, is to identify your own peculiar talent and then to settle down to work with it for a good long time.”

So get back to whatever you love to do!

Programming Creativity: Defy Dogma, Make Waves

TL;DR:

To paraphrase this great talk from Bret Victor:

  • Today’s programmers are growing up with pre-defined dogma
  • Don’t limit what programming is to the box we’re in today
  • Once we admit we don’t know what we’re doing, then we’re free to be truly creative

I saw an awesome talk (link above) from Bret Victor called “The Future of Programming.” Bret comes out wearing a pocket protector and gives a lecture (using old-school transparencies) on everything an engineer from the 60s/70s would have expected of progamming today.

The best point of Bret’s talk I summarized above, but here’s more: we, as programmers, should never limit ourselves to the practices we have constructed. It doesn’t take long for technology to change, but it does take a long time for they way we think to change. Best example: the programmers who were writing code in binary were very resistant to jump to Fortran.

I’ve been writing code full-time for a little over a year now. At this point I am fairly comfortable with a JS framework or two, a language or two, some front-end and back-end design patterns. I skim headlines and do a good amount of reading. I feel confident tackling most hey-make-my-website-do-x requests.

BUT. Until now, I’ve never considered it part of my job to imagine new ways to solve these problems. A huge number of my “solutions” were the result of Googling and sites like StackOverflow. It occurs to me: What if everyone is like me? How does that scale? Is my ability as a programmer limited to problems that have already been solved, solutions outlined? Am I creative? Am I contributing?

I forgive myself for the time up until now, and maybe a few more months. I’m just wrapping my head around concepts like parallelism/concurrency, API design, architecture/system design, etc.

But really, I’m SO VERY GLAD that I saw this video, that I can start pulling this perspective into every day problems, and that there is plenty of time to question everything.

Which reminds me – it’s super important to always question everything: Asking WHY we’re using the tech/architecture/whatever we are using is the best way to learn and form opinions, which is a hugely important part of being an engineer. There’s a great talk on trying to become an expert by Angelina Fabbro called JavaScript Masterclass that talks about this.

Uncle Bob (in awesome talk on software dev professionalism) says (among other things) that we have to surf the waves of software engineering, and when the next wave comes along, we need to jump to it. He’s right. But it’s just as important to jump in and make those waves.

Optimism and Creativity vs Entropy

TL;DR:

Optimism isn’t about hope, it’s about proactive creativity. Creativity counters entropy. It’s our job to create the good that comes out of the bad.


With the help of Pocket, I’ve been catching up on some long-overdue readings, mostly from the mind and research of Maria Popova at Brain Pickings. I also just finished The Book of Laughter and Forgetting by Milan Kundera for the first, and definitely not last, time.

Brain Pickings had a great post a few months ago on the Meaning of Life, and the first entry really got me thinking.

Annie Dillard had a great interpretation of Buckminster Fuller’s quote, “Life is antientropic.” If the universe is falling into disorder and chaos, life and creativity are the opposing forces.

I had just read a bit about optimism from Philippa Perry in this How to Stay Sane post: “I am talking about being optimistic enough to sow some seeds in the hope that some of them will germinate and grow into flowers.”

Optimism gets a bad rap. Somewhere in my mind it’s been slotted next to weak, irrational, and sometimes delusional. And it’s often easier to believe the more pessimistic view is the correct one.

But this material clicked into place. Optimism doesn’t have to mean we’re using a blind or hopeful lens to observe tragic events, or that we’re just waiting for our karma to build up and spill into the ‘good’ side again. Optimism is more about resilience and creativity. It’s more about problem solving. Good doesn’t inherently or magically come out of the bad. It’s our job to be creative and put that goodness together ourselves.

That’s what creativity is: picking up the pieces entropy leaves behind and recombining them into something that’s never existed before.

Angular Jekyll and ngRepeat Headers

TL;DR:

I added AngularJS filtering to this Jekyll blog (on the homepage) via this gist, and I get into an Angular problem I answered in this Stack Overflow thread.


I like to work when I travel, so when I had a few hours between New York and Vegas this weekend, I decided to implement something I’ve been thinking about for a long time: AngularJS filtering in my happy little Jekyll blog.

I’ve been thinking about it for a while, and I’d Googled it a few times. This time, I came across this gist. The simplifying key here is using Jekyll’s Liquid templating to build the array of objects you want to filter out of the posts in site.posts. After that, it’s all angular filtering magic.

Angular filtering gives me full-text search of my blog, which will make it easy to find whatever resource or story I’m looking for in no time. The above gist also features a filter for some nice regex-powered highlighting.

Let me know if you’re trying to implement this, I’m happy to help you debug.


While adding filtering to my blog, a design pattern came up that I’d seen a few months back: headers inside ng-repeats. The problem is the same as in this Stack Overflow thread. Specifically, I had posts in four sections of the blog that I was filtering simultaneously, each with individual headers. At first, this builds out like so:

And this works great! Until your filter eliminates all of the posts in a section, and you have a floating header with no posts. Not a huge deal, but not perfect either.

This turned out to be quite an annoying issue. I couldn’t find an easy way to get the inner ng-repeat to communicate to the outer that it was empty, especially not on the fly, short of building two seperate controllers or working some directive magic.

Looking into the ng-repeat documentation, I found a few helper variables tied to the ng-repeat directive’s $scope. Apparently we can use $first to check if we’re in the first element. Which works out great for us. Check this out:

We can move the section header into the inner ng-repeat, and use angular’s ng-if directive to build that element only when the first element exists. This will remove the section header in the case that the inner ng-repeat is empty. Angular is pretty slick, huh?

A quick note: at first I used ng-show="$first", which works just fine. However, ng-hide/show will still build the element every time, and then set it’s display: none. ng-if (available as of Angular 1.1.5, according to this thread) won’t build those extra headers at all, and lets you keep the DOM nice and clean.

An example showing the before and after:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<script type="text/javascript" src="../js/jekyll-search-controller.js"></script>

<div ng-app="JekyllDemoApp" ng-controller="JekyllDemoCtrl">
  <input type="text" style="margin:10px;float:left" ng-model="searchText" placeholder="type to filter...">
  <div style="margin:2%;width:43%;position:relative;float:left; clear:both">
    <div ng-repeat="section in sections">
      <h5 ng-bind-html-unsafe="section.name"></h5>
      <div ng-repeat="post in section.posts | filter:searchText">
        <span ng-bind-html-unsafe="post.title"></span>
      </div>
    </div>
  </div>

  <div style="margin:2%;width:43%;position:relative;float:right; clear:right">
    <div ng-repeat="section in sections">
      <div ng-repeat="post in section.posts | filter:searchText">
        <h5 ng-if="$first" ng-bind-html-unsafe="section.name"></h5>
        <span ng-bind-html-unsafe="post.title">d</span>
      </div>
    </div>
  </div>
</div>

From Wordpress to Jekyll + Github Pages and loving it

A project I put off for almost a year, and it took just a few hours.

I moved my blog(s) from Wordpress to Jekyll, a ruby gem that builds blogs from Markdown and templates. I’m very excited to get away from the plugin, php, and interface gridlock of Wordpress.

Not that wordpress is a bad option, I’ve used and recommended it for years. It’s just that I’m a developer, and Jekyll feels like the right mix of exacto-knife html/css/javascript control and nerdy bliss that I’ve been missing.

And, now that I have such happy exact control, I can easily add awesome things like this right into blog posts!

Jekyll has many awesome, open-source features that you can add at your leisure, not the least of which were some nice converters for porting all my Wordpress and Tumblr posts into here. (As long as you’re not command-line shy.)

On top of all that, I’m getting free hosting through Github Pages! That’s right, this website at my custom domain was only the cost of the domain itself, plus some Cname and A record adjusting.

TL;DR: Jekyll is awesome. If you’re trying to get it up and running yourself, I’m happy to help troubleshoot. Hopefully, you’ve already got Ruby installed. If not… well, hey, we can figure it out.

Hunger Pains

We are at the beach: blue sky, light wind, perfect temperature. We can’t miss a single moment. But we are hungry, and there is no food, so we eat Alyssa. It was a difficult but satisfactory solution.

Later, we are hungry again. Alyssa’s bones are clean, but she has a brother. Under the guise of burying him in the sand, we trap and eat him too.

The lifeguards have fled. Cops and cameras watch from the boardwalk. The quiet beach finally gives us room to breath. We are satisfied and smug, until we hear a rumble.

We are hungry again.

In-between feelings

It was overcast and between seasons. The grey sky bled down into the leaves and trees, fading the red off the brick buildings.

I have trouble describing how I feel at these times, in those in-between moments, when I catch myself walking alone somewhere, finally with nothing else to think about except what is going to happen next, why am I here, what is life really about. That’s when it’s lonely, when I wonder if the people around me are thinking, or real, or just sleeping.

Where am I going? Is this the right way? Does it make a difference?

JavaScript must-knows: Node, Backbone, and Angular/CoffeeScript/Sass Boilerplate

JavaScript resources this post, touching Node/Express, Backbone, and Angular. Come on down!

Evan Hahn wrote a great Express.js overview that I’ve needed for a while now. NodeJS is a platform for building network applications (i.e. non-static websites) that has become a JavaScript standard. Hahn’s article covers just what a basic Node app is, what Connect attempts to cover/simplify in Node, and then what Express attempts to cover/simplify in Connect. It’s well-structured and readable and I recommend it to everyone. It even gets into some basic Jade for HTML templating, which is a great thing to be familiar with.

I also found a great set of BackboneJS tutorials. Backbone is a popular JavaScript framework that can be used for building web apps of any scale. A basic 3-part tutorial starts here, and would be great if you want to see the way Backbone apps are structured, i.e. what all these Views, Models, Collections, Routers, etc. are for. If you want to get into the more server-side node stuff (with Restify this time) and MongoDB (with Mongoose), dive right in here.

Backbone is a great framework, but lately I highly recommend AngularJS. What’s the difference between frameworks, you ask? As I see it, the framework you choose determines how much “magic” you get. Different frameworks will do different things for you right out of the box (without you having to do anything). AngularJS, for example, does some  beautiful data-binding and live updating that would take a ton of work to achieve in other frameworks. Lots of “magic” can be very helpful, but can also lead to tricky debugging and distancing yourself from pure JavaScript. It really comes down to your personal language and architecture preferences.

That being said, I love CoffeeScript + AngularJS + Sass/Compass these days. I’ve listed below the terminal sequence I run through to get an Angular/CoffeeScript/Sass boilerplate stack up and running in just a minute or two. It’s all done via Yeoman, Grunt, and Bower, and you’ll need to use npm (Node Package Manager, super helpful, you should be using it if you aren’t already). It even includes Karma for unit testing. Execute these commands inside the directory you’d like to add the app to.

{% highlight bash %} npm install yo grunt-cli bower npm install generator-angular yo angular –coffee // Y for yes to bootstrap, scss, and all the angular stuff. npm install bower install grunt server {% endhighlight %}

If grunt isn’t found, try npm install grunt and then grunt server again. To get unit tests running (via grunt karma), you need to change bower_components in karma.conf.js to components. That should work, and if it doesn’t, let me know. I’m happy to troubleshoot with you via comments here or twitter.

Happy projamming!

Get Pocket, teach yourself a new language (and algorithm) via Project Euler, and fail at gaming to get better at life

A quick post this week, as I’m taking some time to build my own WP theme, (using Sass and Compass, of course).

First of all, a fellow Moveline engineer pointed me toward the solution to my obsessive bookmarking: Pocket, a bookmarking app. It not only saves your links, but formats them into a nice view, lets you tag, search, and archive them, and even has iPhone and Android apps for amazingly productive OFFLINE reading, which has immediately impacted my commute. Get the chrome extension. Just saying.

I started learning a new programming language, Ruby, at CodeSchool this week. CodeSchool’s language teaching tools are high quality, and I think it’s a good initial balance of teaching and solving some code problems yourself. They have a handful of free courses, and I got a month-long subscription for cheap because I backed the Ghost KickStarter (which looks awesome, by the way. Also by the way, an old art director friend of mine recommended I check out this KickStarter indie game (Radio the Universe) way back, and I finally did, and it looks just incredible.)

CodeSchool has been a good start, but Adam Gibbons made a great recommendation: just go attack the problems at Project Euler with your new language. Project Euler has over 400 algorithmic puzzles involving things like primes, Fibonacci numbers and palindromes. They are not easy, and I’m becoming addicted. I’m also reflecting on a point Adam reminded me of, something that every developer learns: learning a language’s syntax is completely different from learning how to make code “go” from an empty file. That’s the steepest part of the learning curve, and the most discouraging time. Online teaching tools are a big crutch until you are on your own. Go fail at it now so you can learn how to do it!

If you’re feeling solid or want something else to toy around with, HackerRank seems like a good tool. Try something new! Go? Something more functional? For now, I’m posting my answers to a Github repo (and so are Adam and Chris).

Speaking of learning curves and not giving up, I read a great article on the pain that gaming causes us, and why we do it anyway. “The Art Of Failure” by Jesper Juul seems like a good read, and gets into the idea that we are unhappy when we fail in games, but we are more unhappy when they are too easy. Games can teach us resilience, that we could get it right on even the very next try, not matter how many times we’ve failed before now. Reminds of me of the things I really like to hear Jane McGonigal talk about.

Now go make something, anything, a game, a website, anything! And don’t give up! You’ll probably figure it out in just a few more minutes. And it’ll be fun.

(Graduation) Advice

Before Graduation season has totally petered out (what does that even mean?), here are some addresses I liked recently, and some paraphrased summaries. I recommend all of these for everyone at any time, regardless of graduation-status.

Joss Weedon at Wesleyan. TL;DR: Will you change the world? “Wrong question. You are changing the world. You don’t have a choice.”

David Foster Wallace at Kenyon. TL;DR: EVERYONE worships [something], even atheists. You just do. Don’t let it be the wrong thing (money, power, beauty, etc.) or it will “EAT YOU ALIVE.”

Jon Lovett at Pitzer. TL;DR: See something, say something. “I’d rather be wrong and cringe than right and regret not speaking up.”

My own advice for grads/everyone everywhere:

  1. Dive into what you love, immediately. If you aren’t sure what that is, dive into what you think you might love. Go for the most obvious thing first.

  2. Read fiction and pay attention to the world. Fiction is just incredible for your brain, And some seriously weird stuff is happening in the world. The news (and life) is overwhelming, but the sooner you throw that sail up, the sooner you’ll catch the current.

  3. Take time to be creative. Creating and designing is not just a way to produce something or have fun. It’s the best way to discover yourself and what you think/love.

  4. Remember that everything is incremental. Everything grows and changes a little bit at a time. Don’t try to do everything at once. DO, however, try to do a little bit every day.

  5. Do stuff. Make choices, not excuses. Excuses lead to regrets. Choices lead to autonomy. The answer to almost every opportunity is “YES”.

That is all.

Gettin' mobile-webby wit it (Native vs PhoneGap vs Titanium)

Yes, that was a Gettin’ Jiggy Wit It reference.

Lately I’ve wandered from iOS land into the world of non-native app development, and I’m going to be in hot pursuit of performance boosting CSS techniques, handy-dandy HTML5 tricks, and browser-compatibility smoothing for the next few weeks. This post: two tiny but packed articles and then a PhoneGap Vs Titanium Vs Native comparison. TL;DR: I’m prototyping with PhoneGap because it has the smallest learning curve, the widest reach, and because the mobile web is improving rapidly these days.

I found two great (and very concise) articles on HTML5 from Adnane Belmadiaf last week, one with 5 need-to-know HTML5 features, one with 5 awesome HTML5 + Javascript mobile APIs. The APIs are pretty mobile-awesome, check them out.

I mentioned a few days ago that I found a great PhoneGap + AngularJS tutorial. This was after I spent a few days making the classic PhoneGap Vs Appcelerator Titanium decision. I have always been a huge Native-is-just-always-better advocate, without having done much research into any hybrid or otherwise non-native tech. However, the draw to build once and deploy everywhere is a strong business and dev-speed motivator, and a little research has pushed me into the prototyping stage. Below is my take per platform so far, according to experience plus some readings from StackOverflow, a quick post from a guy who went native over non-native, and a BIG post from a Titanium employee who breaks it all down in a very fair and very informative way.

PhoneGap gives web developers a chance to build an app for every device with a browser one time, using html, css, and javascript (assuming you don’t need any true native functionality). It runs a ‘native’ app that fires up the device’s native browser to run a web app, and connects to device features via the PhoneGap API.

Advantages:

  • Developers can build and test the app in their own browser
  • You don’t need specialized devs for each language/device (at least not for the entire app)
  • Devs can write their own plugins to hybridize (mixing with true native parts of the app)
  • The app can be hosted elsewhere online, giving you magical update-everywhere-anytime powers
  • PhoneGap can hit, what, 7 different OSs? Apple, Android, Windows, Blackberry, etc.
Disadvantages:
  • Web apps might not “feel” native, leading to a potentially poorer user experience (although this is getting better as mobile browsers improve and developers get smarter about performance)
  • Browser-compatibility becomes an issue (although you’d have fragmentation headaches going native anyway)
  • Devs have to learn to work with PhoneGap (there’s always a learning curve)
Titanium from Appcelerator comes with it’s own IDE and can be written entirely in Javascript (again, assuming you don’t require true native hybridization). It focuses much more sharply on iOS and Android, allowing its API to dig a little deeper into those OSs’ core functionalities.

Advantages:

  • A closer-to-native feel that can be written in Javascript (you are basically working with JS-ized native elements)
  • Devs can build their own native “modules” to interact with (similar, I think, to PhoneGap’s plug-ins)
  • Potentially faster-than-native development speed (build once, deploy to iOS and Android)
Disadvantages:
  • Higher learning curve (new IDE, more in-depth API, and no html/css control - you are essentially building a native app with Javascript)
  • Only supports iOS and Android at the moment
  • Devs can’t test in the browser the way they could with a web app (although PhoneGap apps should really be tested on the device/in simulators anyway)
On native vs non-native apps: While non-native apps can save 60-90% of code, there is something to be said for developing a fully native app on one device (say, iOS) then asking a (say, Android) developer to build a replica app from scratch. It’s a great project, and I’ve heard tell of some success stories (and I should add some links here but am tired and will hope you trust me). It can also prevent one multi-OS-assigned developer from the headaches that a single-OS specialist would fly through. Also, native apps can provide the best user experience, although that will really depend on the team building the app.

Fully native apps, however, are not always accessible to the whole development team (unless you are REALLY stacked), and keeping content, style, and updates consistent can become a project management nightmare.

My thinking at the moment: if PhoneGap has the fastest development speed and modern browsers are rapidly improving, why not take that chance? If the UX is comparable and we can avoid the unholy Apple App Store update process with some dynamic content, then I’m sold. And if there’s anything that the mobile web can’t handle, we’ll just link to a native view for that piece of complexity.

I’m prototyping now. The new fear: if my app sucks, is that my fault or PhoneGap’s?

Staying UX to date

A little tech-sposure never hurt anyone. Well, almost anyone. A few quick hits: Staying up to date on the front-end, and some good UX examples (UXamples?) plus readings.

There’s a great little one-pager laying out the recipe for how any front-end developer or code monkey can stay up to date in this constantly evolving world of web dev. Check it out here. TL;DR: follow twitter taste-makers, sign up for relevant weekly emails, go to conferences, and find your own sources. My advice would be to spend some time every week building with something new. One tutorial and one talk per week, no excuses. Mine this week: an awesome PhoneGap + Angular tutorial and a talk about how exactly a browser turns your code into a webpage.

If you’re living in NYC, Poncho is an amazing text-or-email-per-day weather app that has everyone in my office talking. Even if you’re not in the city, checkout the design/sign-up flow. There’s some pretty awesome CSS stuff going on there, and the form feels so effortless. Gets my giant GOOD UX stamp of approval.

Matt Gemmell wrote a really great blog post about designing blogs for readers. What you need, what you don’t need, typography, examples, etc. I’ll definitely be referring to it when I find the time to rebuild this blog, a project that at the moment is scheduled for “Never”.

For some nitty-gritty UX, I found this post on Mind Maps by Jenny Grinblo. Mind-maps are a great way to break down your idea/product into user stories, which should be driving design/development anyway. I should use one for the redesign I’m never going to get to. I won’t, but I should.

LESS and/or Sass = CSS bliss

What’s up code-monkeys? This post is all about CSS. In just a few minutes, you’ll be able to style with, um, style.

For the first few months of my hack of a web development career, I’ve been writing CSS the way I thought it had to be: pure CSS. Different projects had different levels of organization, from well-named, modular files to disgusting, hundred-line Frankenstein monsters. I’d heard of CSS preprocessors, but hadn’t gotten into them. It’s definitely important to learn the basics, sure. But once you can ride a bike, you might as well get a motorcycle. Especially if it’s free, downloads in seconds, and makes you a much better, um, bicyclist.

The two most popular preprocessors are LESS and Sass. Choosing between them is not as important as just picking one and using it. They both have several awesome features that will immediately speed up your styling. I’ll briefly get into three of them: nesting, variables, and mixins.

HTML is nested, so why shouldn’t your stylesheet be? There are examples on both websites, but here’s the gist. This:

{% highlight css %} .post{ color:black; } .post a{ text-decoration:none; } .post a:hover{ color:green; } {% endhighlight %}

can be written like this:

{% highlight scss %} .post{ color:black; a{ text-decoration:none; &:hover{ color:green; } } } {% endhighlight %}

So that, logically, styling the <a> tags inside the class .post is handled inside the styling of .post. In both LESS and Sass, the & is used to append other classes or states (ex: :hover) onto whatever element you are already styling.

Variables do exactly what they should. You can assign any value at the top of your stylesheet, and use it throughout your stylesheets. No more copying and pasting of color-specific hex codes, or hoping you set all the fonts, line-heights, and border-radii properly.

And if that doesn’t convince you, Mixins will. Mixins act like variables for full styles, rather than just values. They are simple to write, and you can reuse them everywhere. The example from the LESS homepage uses Mixins and an @radius variable. Instead of this:

{% highlight css %} #header { -webkit-border-radius: 5px; -moz-border-radius: 5px; -ms-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px; } #footer { -webkit-border-radius: 10px; -moz-border-radius: 10px; -ms-border-radius: 10px; -o-border-radius: 10px; border-radius: 10px; } {% endhighlight %}

You can create this mixin:

{% highlight scss %} .rounded-corners(@radius: 5px) { -webkit-border-radius: @radius; -moz-border-radius: @radius; -ms-border-radius: @radius; -o-border-radius: @radius; border-radius: @radius; } {% endhighlight %}

And apply it to elements like this:

{% highlight scss %} #header { .rounded-corners; } #footer { .rounded-corners(10px); } {% endhighlight %}

And on top of writing your own mixins, there are of course many that have already been written available all over the web. Here are some for LESS, here are some for Sass. As Chris Coyier of CSS Tricks says, preprocessors make CSS fun again.

I recommend both LESS and Sass. They both come with more than I mentioned here, including nice-sounding things like functions and inheritance. If you’re command-line/terminal shy, you might have an easier time starting with LESS, because you can compile it in the browser (just add the LESS compiling script to your HTML). At the same time, I’d encourage you to cozy up to the terminal soon. You’ll be glad you did.

If you’re really gun-hoe about Sass, good for you! :) Checkout Compass. It’s a ruby-gem that provides you with a ton of CSS3 mixins right out of the box. Chris Coyier says Sass + Compass is the best way to CSS, and I trust that man. I’m using this combo to build a Wordpress theme now, to replace the default I’ve been riding for the last few months. (If you’re interested, I’m starting from a design-stripped theme called _s.)

So, in summary, preprocessors are awesome. Use them in your next (all your future) project(s). Want to get even better? Learn how to use Twitter Bootstrap. Read the documentation! It’s a powerful scaffolding tool and component base for any website’s style needs, is fully responsive, and is written entirely in LESS.

Manster or Hamtaur?

This is the story of an extreme girlfriend that wanted her boyfriend to look into scientific procedures for shrinking and merging his body with a hamster’s in order to carry him around in her pocket and call him Hamster Huey, and of the grotesque boyfriend that resulted thereof. These are some of the activities they did together afterwards:

Skiing

Couples-counseling for partial-human relationships

Snowboarding

Mountain biking

Couples-counseling for incompatible relationships

Skydiving

Couples-counseling for single-income relationships

Complicated and expensive legal-proceedings related to side-effects of experimental surgery

Couples-counseling for disproportionately-sized relationships

Regular physical therapy and ritual anti-inflammatory medicinal intake

General couples-counseling

Surfing.

The smaller you are, the more you'll grow

I read a great article this weekend by Rebecca Murphy. It’s not new, but is still very relevant. My favorite point was this: ”Getting good at a thing involves seeking out opportunities to feel small.” If you want to be good, don’t let yourself get comfortable. Comfort is static. Keep shifting gears, keep tackling new things. Uncle Bob says software developers need to surf the wave of whatever language is in style now, while keeping an eye out for when to jump to the next one.

I saw a great slide deck from Chris Coyier last week, called How to Stay Up to Date on Web Technology. My big takeaways have been a shift from reading to doing. He mentions a number of weekly newsletters from great divisions of your programming skill set. These weekly check-ins are perfect: you don’t get caught up in the day-to-day opinions. instead, you keep your ear to the ground, scan the headlines, and don’t miss anything big. Sign up for some! My suggestions: SideBar, Web-Design-Weekly, WebDesignerDepot, and  Smashing Magazine.

This week I’ve been hacking away at my to do lists and saved articles. Reading won’t help nearly as much as trying to build something, or going to a conference or hack-a-thon to see what you’re really made of. Check out things like MeetUp and Start-Up Weekend. Like Murphy said above, put yourself out there and make yourself feel small. That’s when you’ll grow.

Now, some links from my week for you. Take one or both of these and have some fun.

Programming (open-sourced and otherwise) continues to build on itself, and by now there’s a library for almost everything. Here’s a javascript-based physics engine called Verlet (with a TERRIFYING spider demo), and here’s Packery to help you achieve that modular layout you’ve always dreamed of. (By the way, both of these came from my weekly subscription to SideBar, mentioned above.) 

Also, if you’re looking for some tunnel vision, checkout this CodePen CSS example. That’s all HTML and CSS, folks. No javascript at all.

Build something! You’ll be glad you did! And then let’s do a hack-a-thon together.

The best way to play NES games, and game dev resources

I saw a great article in Wired this weekend about Tom Murphy, a software engineer who built a generic program to play NES games. He built two tools, one to record himself playing his NES, and one to play it on its own. It does pretty well! It finishes a few levels!

The amazing thing is how simple the program is, and how it applies to multiple games (except Tetris, as you’ll see). The program doesn’t use any pathfinding or advanced algorithms. It maps input from the controller and a relative screen position for the character, and then uses a few constraints to try to increase the player’s score. Watch the video to see it trying to beat Super Mario, Karate Kid, Pac-man, and Tetris.

The article mentions that there are other competitions for Mario-playing algorithms. Check out this super smart Mario AI in a chaotic custom made level.

I’ve dabbled in game development, and if you’re interested, there are some great resources. On iOS, Ray Wenderlich is still king, with tutorials on beginning, intermediate, and advanced game programming (not to mention everything else iOS). Ray’s site has tutorials for getting into Cocos2d, which can give you plenty to work with. If you want to add physics, Chipmunk and Box2d are great options. If you want an even bigger jumpstart, King Wenderlich just put out a great set of starter kits.

If you’re iOS-shy, there are tons of JavaScript gaming frameworks. I’ve been toying with ImpactJS for a while and enjoying it. It’s not free, but it is simple and includes a level editor.  There are other options too, for sure. Maybe Enchant.js? When you’re ready for prime time, maybe something like Unity3D?

Of course, you could just keep playing MineCraft.

Mapping memories, NaNoThon, and Structuring productivity

If you only read the first sentence: create every day, and keep putting yourself out there! I’ve posted a few more poems on Medium, and am enjoying how easy it is and the attention it is getting (over 500 hits on this How-to-write-a-poem post, thanks to a kind Editor’s Pick and front-page feature). I’m also trying to get a picture up with every one. Rather than getting into techniques for optimizing organic web traffic, I’m just going to say: people like that kind of thing.

Breaking your routine or being creative in other ways is an amazing way to discover new internal topics or to get through writer’s block. One of my favorites is doodling or drawing before you start writing, but sometimes that’s still too open-ended. Try drawing a map, especially one based on your memories. A more visual friend of mine (who really understands creativity) recommended this way back, and of course BrainPickings knows what I’m talking about. For this poem about the street I grew up on, this was the prompt: Draw a map of where you grew up, featuring exactly seven locations. Then write.

Today (right now!) is an all day marathon of writing from the Office of Letters and Light (aka NaNoWriMo). This #NaNoThon is a good time to drop everything and finally edit that chapter or story you’ve been putting off forever. It also brings up a few ideas I’ve been processing for a few days.

I tend to over-organize (it keeps the overwhelming-ness at bay) but I think it’s SO important to structure your productivity. I’ve fallen away from it lately, and it has been a struggle. I mentioned in this Scheduling Creativity post (featuring thoughts from John Cleese on taking your 90 minutes) that it’s crucial to put the time in when you can. But lately I’m learning that it’s also important to take it easy.

I get bogged down in the always-having-to-do-something mindset. Talking this over with some other creative workhorses, I’m learning I would be happier and more productive if I scheduled specific hours of the day to write fiction or to program, instead of maintaining an exhausting and constant grind through my to-do list. Constant work over the course of many hours or days is not as productive as focused, powerful segments of reasonable length interspersed with time off. Especially when I’m tired, those extra hours tend to be a waste, when switching gears or taking the evening off would have been an investment in the next burst.

I’m not saying you shouldn’t grind it out. Sometimes you need to, and when it’s right, I’m all about that. But don’t let your to-do list loom over you or slow down your overall speed. Everything gets done one thing at a time, or not at all.

For that time in between sprints? I dove into Brave New World and House of Cards last week. Do whatever you want! Your brain will appreciate it.

Uncle Bob Demands Professionalism and Test-Driven Development

I watched a presentation last week: Uncle Bob on Demanding Professionalism (in software development) (80 minutes. It’s worth it! Or here it is in 30 minutes, without the TDD intro). It was my first exposure to Uncle Bob Martin, and it won’t be my last. The video made me very excited about working with Moveline’s Test-Driven Development process, and for the future of the software and web development industries. Uncle Bob knows what he’s talking about, and it just seems like so much fun. (Nerd alert.)

The talk starts with a Test-Driven Development (TDD) of a Word-Wrap function. (Note the use of emacs as a text editor, and of course the unicorn that skips happily across the screen every time tests pass.) If you write code and you’ve never heard of TDD, here’s my attempt at explaining it. TDD is a way of writing software in which you write ‘tests’ before the code itself. These ‘tests’ represent everything that your code needs to be able to do (Requirements).

In the video’s unit-testing example, the Word-Wrap function needs to be able to handle a number of different kinds of input (some with spacing, some at various lengths). Our test-writer is here will use tests to put this Word-Wrap function to work. Because we are human and smart, we know what we want output should be for every input. Tests essentially give the function a known input and ‘expect’ a known output, then pass or fail based on that output.

So, before even writing the Word-Wrap function, we write a test. When the test fails, you are free to write the function, specifically to pass this test. When the test passes, you are golden, and that input case will always be handled as long as your tests are passing. Then you write the next test. Ideally, you write tests for every possible input case, providing you with a robust Word-Wrap function, with the bare-minimum of code needed for that function.

Now imagine scaling this across an entire app. Every feature you add to the app is minimal, fully-tested, and ready to go live at any time. TDD takes a bit longer up-front, but saves HUGE amounts of time dealing with bugs down the road. And refactoring becomes completely stress-less. If your tests aren’t passing, you broke something. If they are, you’re fine. It’s as easy as that.

TDD has a number of very serious advantages. Unless you are just prototyping, take the time to get it right.

Now, back to Uncle Bob. If you can’t see the whole thing, Uncle Bob makes a few strong points. The Software industry is incredibly young. Right now, people don’t have a great idea what developers do (aka, we’re magic wizards playing with big powerful toys). Some of us are responsible, some of us are not. At some point in the future, some developer will accidentally cost humanity thousands of lives. This is a problem, but it’s probably unavoidable. At the same time, it can be kept to a minimum if we are professional. When this big accident happens, the people will point at us, and the governments will want to certify and regulate us. But they don’t know what we do the way we do. We need to figure out what our profession is/should be, before someone else does for us.

So, Uncle Bob, as our new CTO, has certain specific expectations. His list is very, very good. This post is getting long, so, in general: be honest, work hard. Don’t be afraid to touch the code, or it will begin to rot. Maintain stable productivity. Continuously improve the code (don’t be lazy or impatient!), don’t start from scratch, make it better. Don’t make a mess! It only slows you down! Don’t be precise with deadlines, be accurate. If you’re interested, watch one of his talks, they are all awesome.

A new Medium, and how to write a poem

I needed a change in my writing. I don’t know how I knew. Sometimes you just do. This month, an old friend and I are going 3030. I haven’t done any research yet but I’m pretty sure that means: One poem per day every day this month. So far I’m 33 and enjoying it.

I posted my poem from Day 1 on Medium, the ostentatiously ($100 word, i know!) titled: How To Write A Poem. I will be uploading more random writings over the next month and beyond right exactly here.

Medium is nice. I wish I could have done it more anonymously, but it is tied into twitter, which didn’t make it easy to change that photo. I could have created a fake twitter account, but hit a brick wall of laziness topped with new account name and password barbed-wire. Medium’s formatting bugged me a bit, especially pasting from Word, but I found some work arounds to fix the double-spacing it enforced. (Muahaha. Textfield hacks, anyone? Highlight everything, turn “quote-block” on, then off again. [UPDATE: Shift+Enter does away with the extra spacing. As with almost every blog-text editor these days. face palm])

If you’re in a rut, jump forms, and write some poems. Sometimes it’s easier and can open you up. You don’t even need complete sentences or any excuse for putting down random words. Have some fun!

Love your email app and find the legendary INBOX ZERO every day

We spend so much time in our inboxes these days, why not make the most of it? I only recently moved away from Gmail’s browser app for all my communication, and it has made my daily workflow smoother and less overwhelming.

First of all, get to inbox zero! It’s only a few clicks away! Mark all as read and just be done with it! Then, most importantly, start two habits: Unsubscribing from email you don’t care about, and set up filters to mark those you don’t read as read. For me that means finally unsubscribing from worthless PlayStation Network emails I don’t read, and setting up filters for Github repos I supposedly “watch.” You’ll be much happier! And you’ll free up time for the important things. And there’s a certain bit of satisfaction I get when I unsubscribe. It almost tastes like…freedom.

I’m now using Sparrow as my native Mac email app. You can get it here for free. It looks like you have to pay, but if you scroll down to the bottom of the page, there is a download link on the left. Toy around with it if you get a chance. I was told they were recently bought by Google and have since stopped development, but the app as-is serves my needs without the memory-eating overhead of a Chrome tab. Take advantage of the keyboard controls, they’re pretty sweet.

[Side-note: I’m loving the try-for-free, pay-later-if-you-want business model. I’m not sure if it’s the best for making money, but when companies trust their product enough to let it sell itself, it produces tons of advocates. See also: Sublime Text.]

My recent favorite is a mobile email app called Mailbox. It operates on the inbox zero philosophy, helping you reach the golden 0 every single day. It’s done wonders for my scheduling, priorities, and focus. First, you move all your mail into an archive (called “All Mail”). From then on, any mail that comes into your inbox can be archived with a swipe to the right. With a short swipe to the left, you can “Snooze” the email, which allows you to set a time at which the email will pop back into your inbox, like new. This leads to me dealing with important things immediately, putting off fun things to the weekend, and scheduling ticketing/event based emails for the day of the event (meetings, Amtrak tickets, and concert necessities will sit quietly until the right time). I never thought the native iOS mail app was broken, but now I feel like Mailbox fixed it. And it’s free (once you’re done waiting in line).

Get on top of your email. It’ll make you happy. I’m sure there are more fancy little email apps out there! Share if you love any.

New York Tech Meetup, Image Search, Good Karma, Layout + Typography, Angular JS, and Code School

Lots of goodies for you this week, mah nerds. I’ll try to keep it concise.

Last week was the New York Tech Meet-up for March, and my company Moveline gave one of the featured demos. There’s a quick mini-review here that touches on it. Besides Clarity (an app to help teachers and parents cross the language barrier) and Yext (a location-control resource for businesses), one demo of note came from Shutterstock, who is trying to fix image search. Their Labs page features two different options, Spectrum and Instant, both of which are great tools for anyone looking for the perfect piece of stock art. Check them out and take a look at that colorful bubbling beaker on their Labs page.  The bubbles are pop-able! I love it.

This weekend I got finally got my Karma! Karma is a pay-as-you-go wifi hotspot. I’m super excited to see someone finally solving the global wifi problem. Anywhere you can get 4G, your Karma will give you wifi that you pay for based on what you use, not some monthly subscription. Other people can use your hotspot too, without it costing you more. In fact, if other people sign up through your Karma, you both get 100 mb for free. It’s a sweet deal for anyone who travels and works, and it can fit in your pocket.

I found two nice tools for teaching css and typography this week. Since I’m way behind in my HackDesign course, these helped to placate me, as they are both quick yet very helpful. Learn CSS Layout and the Interactive Guide to Blog Typography are both very practical and well-written guides on exactly what they claim. I recommend both to any designer or developer.

We got into AngularJS at work last week, and I am LOVING it. The ease of data-binding and the speed of the filters and live DOM editing is incredible. I built a demo this weekend that still looks scrappy, but that I’m hoping to get up live somewhere soon. It pulls in little stories from my tumblr and lays them out like bricks, and is fully filterable/searchable. I’m hoping to add some ordering and maybe some minor gaming elements. We’ll see if I have time for that.

AngularJS is awesome for many reasons, and right now we are loving the ease of testing. Our development at Moveline is very Test-Driven, and we are proud. I’m trying to carry the practice into all of my own development, because it saves SO much time in the long run if you have the up-front patience. It makes refactoring so easy, and if you break code moving things around, you know immediately. Having tests is so nice.

Anyway, check out AngularJS. Here are some TutsPlus highlights, and two great guides from Year of Moo. Oh and why not, here’s an extra about full-spectrum testing with AngularJS and Testacular.

I just found Rails for Zombies, and that took me toward CodeSchool, which teaches all the things I want to know right now: JavaScript by Framework, Ruby on Rails, HTML/CSS, iOS. I’ll find the time to dive in and let you know how it goes.

Other upcoming topics I’ll get to in the next few months: Templating Technologies (Slim? Haml? Jade? Handlebars? Isn’t Angular enough? And what is Jekyll?), AngularJS vs EmberJS, CSS-preprocessing with LESS and SASS (I just wrote my first LESS files last week, and I’ll never be the same.), and, of course, some of my favorite Vim Plugins and shortcuts. For now: I just discovered that hitting Shift+Command+T in Chrome will open up the last window you opened, aka the window I close accidentally all the time.

Don't force it, but use the force

I have been writing a lot of code lately, and my fiction and journals have suffered. However, a break is not always bad. Perspective and some fresh air are crucial to moving in the right direction. I took the time away to have a healthy, honest conversation with my muse.

First of all, she is beautiful, so whatever she says is correct. What is changing for me is the intended output of my writing work. I have been building toward a novel idea (which has since fallen to a more realistic set of writings/stories/essays) and I have been desperate for some kind of meaning in my work. I thought I could force it. I wanted to write essays with big, sweeping titles, like “Death,” or “Life,” or “Love.” I wanted to make remarkable points that people knew but had never articulated, or bring some perspective they’d never considered.

This, according to my muse, was nobel, but also naive, ridiculous, and cliché. Writing is about writing what you know, about identifying yourself and what you feel about things, about using your own life to figure out how a few things work. If you’re lucky, foraging through the wilderness of your own head will lead to an oasis or mapping of some kind, and a good writer can bring this information back to the world.

I’ve written and thought about the importance of journaling before, and will continue to do so, but I need to focus on it in a new way. I have been too objective and factual, as opposed to emotional or questioning. I need to be more honest.

My writing up to this point has been about writing stories. It’s been plot-driven. It’s been about what happens to people, usually something ridiculous, in a world that is arbitrary. It has rarely been about why things happen, or how it impacts these people. It hasn’t been about emotion. The characters haven’t been real, they’ve been empty bodies with lines of dialogue filling roles in a story that’s already been outlined.

I’m going in a new direction for a while. I’m going to journal about things I’ve experienced, and be honest about them. I’m going to get in touch with the world I’m in now, the one I’m experiencing, rather than building ones out of arbitrary little ideas. There is so much to tap into in the world around us, if we’re open to it.

I’m also hoping to start attacking some writing prompts on a regular basis, for more practice putting words together. I’m taking Figment prompts and I’m going to write some things at Medium, a blogging tool from the Twitter guys. Very likely the stories will appear Under a Well. This is a step away from my 100-worders, which I’ve neglected for a time, but I need something a little bit more free-form.

Write on, writers.

My workflow settings in the Cloud: Zero to Hero to Boxen

Getting a new computer up to speed can take hours or even days. Finding the time to do so without cutting into your own productivity can be an issue.

I just got a new computer (Macbook Pro 13”, non-Retina) a few weeks ago, and had been keeping an exhaustive list of everything I did to it, thinking it’d be a helpful tool for anyone interested and my next computer. Making this list seemed like a painful but one-and-done process. That, however, was before we started using Boxen.

Our Lead Software Engineer, (my boss) set our engineering team up with Boxen, which is an amazing tool from Github that makes it easy to bring a new Mac up to speed. It uses Git and Puppet to automate the process of bringing any computer up to date with your personal settings. Once your team’s boxen is set up, all it takes is a curl call and a “boxen” command in the terminal. Not only does it pull in personal dotfiles and mac preferences (such as hot corners and dock location/size), it can also pull in and update git repos and native applications. Checkout the applications that boxen has available already (or grab the template and create your own).

So, right now, I can jump on any computer, set up boxen with a curl call, sign into github, and run “boxen.” This command will install the four or five repos I work with every day, my dotfiles (with tons of vim settings), and DropboxSparrow, Spotify, Sublime Text 2, Hipchat, iTerm2, and Google Chrome. That’s incredible.

After that, if you stay up to date with your boxen repo, your personal dotfiles repo, and you create puppet packages for all your applications (I need to add one for Evernote, for sure), you’ll be ready to jump to any new computer and get everything running in minutes. Your computer is waiting for you, wherever you go, in the cloud.

Now for my lame Zero-to-Hero list. Here are the highlights.

Applications: Chrome, Xcode (and the Command Line Tools), iTerm2 (with tmux), HipChat, Evernote, Dropbox, BetterSnapTool, Sublime Text 2Flux, and Spotify.

Via the terminal and then via homebrew: Homebrew, Node, npm, rvm, CoffeeScript.

For my vim, bash, and zsh plugins/configs, checkout my dotfiles here. Note that all credit for these so far is due to Chris Garvis and this post on StackOverflow. If you’re going to install a handful of vim plugins, remember to grab pathogen first. It’ll make your life much easier. I’ll get into a few of the plugins I love in a later post, but for now, for you front-end vim developers, checkout Zen-coding.

Happy Coding, code monkeys. And Happy St. Patrick’s Day!

An Assortment of Goodies: Progressive Reduction, Parallax Scrollers, Backbone-Hangman, and Heroku

This post is a little bit of UX, a little bit design, and a nice pair of tutorials to build your first backbone app (as a hangman game) and then push it live with a Heroku dyno.

User-experience drives everything (duh). Given the incredibly dynamic and data-driven internet, I’m surprised we aren’t seeing more attention given to Progressive Reduction, an idea that I first read about at LayerVault’s tumblr. Progressive Reduction is simple enough: the more often users visit your website or use your app, the less you need to explain what all the buttons do. First-time users or those who haven’t been back in a few weeks will get more labels and different call to actions than those who are coming back twice a day. If you’re interested in implementing it, Aware.js is a nice jQuery plugin designed to handle this idea.

I’ve been sitting on this link for a long time, hoping to write a much larger post about parallax-scrolling, but my reading list for that is only getting longer, so I’m folding. HoboLobo.net is a story told by one man, who is a triple-threat creative: writer, artist, and web developer. The depth implied by the parallax is pretty incredible, and is a nice example of how innovative the web can be. He’s also included a tutorial explaining how he did it.

A week or so ago I was hoping to nail down my understanding of Backbone.js, and this backbone-hangman tutorial proved very useful. Check that out, play the demo, or go straight to the source code. It involves a taste of a Ruby server through Sinatra, and some templating with Haml and Handlebars. Great exposure for any javascript developer.

When you’re ready to push it live, check out Heroku. Create an account and run through this getting-started with Heroku-Ruby tutorial. It’s not so bad if you’re familiar with git and the command line, and willing to google around any issues. In the end, one dyno is free, and is really all you need for a dev environment.

I just got a new work computer this week, and I’m putting together a link-heavy post on taking your new mac from Zero to Hero. It’ll be a list of everything I’ve installed, from Chrome to Vim plugins. I can’t get that live yet tho, as the new machine is still hovering somewhere in that average-joe range.

Scheduling Creativity

Work and life demand much of our time. Finding time to be creative can be very difficult. Build and hold a routine, and hold yourself to it with military optimism. You will win the war, if you work hard enough. But what to do with that time you set aside?

There’s a talk on creativity from John Cleese on BrainPickings in which he outlines the circumstances that most often lead to creativity. I recommend the video, but in a nutshell, he mentioned 5 necessary elements. We need an oasis of space (1) and time (2) (ideally 90 minutes) in which we are cutoff from everything else. We need time (3) to tolerate the discomfort of not-having-reached-the-best-solution-yet (i.e. don’t take the easy way out). We of course need confidence (4). And, lastly, humor (5), which he sees as the fastest way to step from closed- to open-minded thought patterns.

For me, finding the time is all about fighting two things: priorities and procrastination.

For priorities, John Cleese (and many others) note a huge difference between things that are important and things that are urgent. When you finally have that time, do what is important, not what is pressing or easy. Do the big ones. Don’t be intimidated, don’t put off a big project just because a little one is easier.

Procrastination is the enemy of the mind and soul. Defeating procrastination is all about doing it right now. Pump up your self-control and your will power. It’s hardest to defeat the first time. And once you’ve done that, it’s not quite as hard the next time, but soon you’ve got a habit, and then you’re golden. What are you doing right now? Why are you doing that thing that you’ve always wanted to? Why aren’t you writing that story you’re thinking about? DO IT RIGHT NOW. You’ll be happy you did.

UX examples and resources, web design for hackers, beginning backbone.js, and modernizr

What’s up, code monkeys? Another post, another slew of things I loved and would love to share with you.

There are a handful of websites collecting and glorifying examples of great web interaction. Small Nudges focuses on ways businesses are nudging users toward conversion. Little Big Details and Pattern Tap bring us great examples of user interaction. I may have mentioned UI Cloud before, but it belongs in this group, as it is essentially a search engine for UI elements. Web design is getting cleaner, faster, and more intuitive as we continue to raise the bar, and these sites are a great place to check in on the latest trends.

If you’re not a designer, (I’m definitely not) there are still great ways to learn and contribute to the design of any project, even for you logic-based, nerd-alert programmers who spend hours each day staring at, basically, the matrix. Exposure to great sites like Smashing Magazine, Web Design Depot, and CSS-Tricks are always great (and just look at how well-designed they are!) I recommend their newsletters very much, because they filter for you. Let them pick the good ones out before you overwhelm yourself.

Another great site is Sidebar, which gives you no more than the 5 best design links of the day, or if you sign of up for their weekly email, the 7 best of the week. I have yet to be disappointed. Also, check out Hack Design. I haven’t had time to dive in yet, but it seems to be something like a crash course in design for all those coders who ran through Codecademy.

I learned to implement Modernizr for the first time last week at work, and was oh-so-impressed. It solves all kinds of browser css issues that I’ve been so afraid of for so long. Now I feel you can truly design for the latest-and-greatest Chrome, and patch IE later. I hope that’s not too naive. I think the catch is that it works best with a really well-designed front-end. We got it going without much trouble.

For you hard-core coders, I am really enjoying working with Backbone.js. It was complicated at first, but it is making more and more sense lately. Check out this hangman tutorial. I ran through it a few days ago and loved the exposure to a Ruby server using Sinatra. I’m hoping to get Heroku involved this weekend so I can push my own hangman game live. So much to learn!

P.S. A friend of mine is diving into programming now, and he’s finding great things on coding-related subreddits, including these squishy toggle buttons. I’m sure there’s wonderful stuff there, if you’re looking for more.

Creative excuses

I’m asked to be creative everyday. This morning, it’s what to do about underwear, three days after what should have been laundry Sunday.

Sunglasses on the subway – twin shields, bold first lines of defense against the eye contact of the general public.

The second line is staring at your phone or shoes or that eww on the ground.

The third is headphones, even if they’re not on. They remove your senses from the context of the train, and you can excuse interaction as dancing or wandering-pseudo-music-video eyes.

The fourth? Reused underpants. No one is looking at me at all.

An interview with the cranes on top of the Freedom Tower, whose names are Mel and Gilgamesh

How did you get all the way up here?

Mel: I wanted to be a swan, but I was born here instead.

Gilgamesh: Elevator.

What’s your favorite part of the day?

Mel: Pretending to be a swan.

Gilgamesh: Sunset.

How does it feel to be working on the Freedom Tower?

Mel: I’d have been a prouder swan.

Gilgamesh: Ironic.

Play any music while you work?

Mel: Swan Lake.

Gilgamesh: No.

What are you going to do next?

Mel: Swan dive.

Gilgamesh: (shrugs) Taxi-driver?

Anything else?

Mel: Nope.

Gilgamesh: Advice for the weary: The opposite of love isn’t hate, it’s indifference.

The Stepford Whites

“I told you moving here was a bad idea. When it doesn’t stink, it tastes like paste.”

“Oh hush. You’re always aching.”

“And it’s creepy! Something feels… off. I’m not sure what.”

“Oh relax. What could be wrong?”

“I don’t know. Isn’t it weird we haven’t seen any babies in so long? It’s been years!”

“Well, there’s just no room, is there? Where would they go?”

“And, call me crazy, but something has happened to Betsy.”

“Like what?”

“I don’t know… since I woke up from my nap this morning, she’s been… false.”

“Honey, I think you’ve gone completely dental.”

Guest post (Brock): It's not a phase!

A new trend is emerging among middle to high schoolers: an offshoot of the “emo” fashion made popular several years ago by bands such as HIM and The Used, the new “retardo” culture reimagines emo’s themes of edgy loneliness. The big difference? Where “emo” focuses on themes of self-harm, depression, and even suicide, “retardos” see themselves as simply inept, falling short of the social standard – particularly regarding intellectual pursuits. Fashion-wise, children in the retardo “scene” wear helmets and stained sweatpants, cross their eyes, and maintain a slack-jawed expression. Some use permanent markers to draw strings of drool on their chins.

Guest post (Brock): Brain teaser

I have a challenge for you: imagine you’re eating a big bowl of rice, and suddenly you find a giant piece, about as big as a big toe! What do you do? Do you call the museum, or the police?

Now imagine you’re eating a big bowl of tonsils, and suddenly you realize they’re full of tonsil stones! What do you do?

Finally, let’s imagine you’re back at that big bowl of rice, eating and eating, when suddenly you find the big piece of rice! But this time, it’s not a big piece of rice.

It’s a big tonsil stone!

Guest post (Brock): Hitler

The Nazis won. Hitler’s men marched across Europe, crushing Stalin’s defenses in a grand, orchestrated sweep. Towers fell; all knew the taste of oppression, bitter German steel.

As the years went on, Hitler mellowed out a lot. He’d really just been going through a bad time in the 40s. Once the 60s rolled around, he was pretty approachable, not a bad guy to be around.

The Producers still got made, even though this is an alternate timeline. Hitler loved it, and invited Mel Brooks to his birthday party in the Eagle’s Nest. Their friendship lasted until Hitler’s death in 1982.

20+ Technologies in 6 days at Moveline: Links onnnn links

Last week was my first week at Moveline, a startup that is changing the way people move. Ramping up to the speed and technology of a cutting-edge business has been overwhelming and brain-blasting. Below is an attempt at a comprehensive list of the new vernacular.

The first big shift was not a language or a framework, but actually writing the code. I dove head-first into Vim, a text editor from 1991 that is still very efficient today. Vim saves you that precious time when you move your hands off the keyboard to the arrows or mouse, which might sound crazy, but once you rewire your brain, the little things add up. There are thousands of shortcuts, and after six days of mental heavy lifting, I’m starting to get a feel for them. For extra practice: Vim Adventures, and Vim Golf.

Vim is used in the terminal or on the command line, so I’m starting to pick up those commands as well. These kinds of things (like all programming questions) are google-able.  I’ve also just learned about dot-files, which can be used to set up custom settings. In my case, I wanted the best of vim configurations, and for now I’ve picked up most of my vimrc from my new mentor. I’ve also installed tmux (the terminal multiplexer), iTerm (a nicer Terminal), and Ctrlp (fast fuzzy file searching).

Beyond writing the code, I’m adjusting to version control, aka Github, and all the adding, committing, pushing, pulling, merging, and everything else that goes along with it. Practice makes perfect, right? And if you’re looking for practice, check out ShortcutFoo. It’s got shortcut commands for Vim, Sublime, Excel, Photoshop, Git, etc. By the way, if you’re not willing to jump into the terminal or command line, Vim + Sublime is a great way to go.

Once that’s set up, there’s the development and testing environments, and all the testing. We run a VM using Vagrant and a suite of sweets for testing: Cake, Cucumber, and Mocha, and I think there was a Chef involved.

Now for the actual code base. I’m still getting a grasp of the apps we are running and how they’re organized, so here’s some gibberish: Node.js, Backbone.js, and MongoDB (plus Mongoose). Then there’s Heroku and Continuous Integration kicking the dev cycle into over-drive.

Outside of all of this, there is the employee workflow. Constant communication is maintained through HipChat and GroupMe, tasks and projects are maintained perfectly through Sprint.ly (which connects very nicely to Github), and calendars and other communication is as simple as gmail (which didn’t need a link, but while we’re at it).

To wrap it up, I picked up some helper apps for my mac that were in the company culture: the BetterSnapTool brings Windows window size options to the mac, and Flux will modify your computer’s display colors to match the sun. It’s nice to see the sunset after a long day of programming. Time for for my CoffeeScript.

You don't wanna

That girl? You don’t wanna dance with that girl. She’s got leftover feet. Man feet. Clumsy, stinky ones.

That beer? You don’t wanna drink that beer. Gordo drinks that beer. They soak it in gym socks before they let the monkeys swim in it.

That seat? You don’t wanna sit in that seat. My grandfather died in that seat. And my grandmother. They looked just like you.

That burger? You don’t wanna eat that burger. Lemme take it off your hands.

Thab book? Iths predy goob acthually. (Gulp) Wait, did you say this one? You don’t wanna read this one.

(Brain)Picking(s) out meaning, diaries, losing your head, daily poetry, and the War of Art

Today, a slew of BrainPickings for you, daily poetry that will Rattle you, and a serious battle with Resistance.

My still favorite website BrainPickings has a few more must-sees I came across this week. This is Water: David Foster Wallace on Life is a commencement speech Wallace gave that everyone should hear, about avoiding the shallow autonomy, the default behaviors, and the thought processes of daily life. If you can, give Part 2 of the speech the 12 minutes it deserves. He’ll tell you what the Capital-T Truth is.

Virginia Woolf on the Creative Benefits of Keeping a Diary is giving me a reason to keep journaling every day. When I sit down at a meal or on the subway with my notebook, I am always fighting a battle between boring, this-is-what-happened-today stuff and diving into a story or poem. What comes out is usually somewhere in between. In the article, Woolf defends the rambling notes of her diary, noting that it “loosens the ligaments,” which leads to an “increase in the ease of her professional writing.” She also says she might eventually learn what to “make of this loose, drifting material of life,” which is a good reason to let the words spill.

What sort of diary should I like mine to be? Something loose knit and yet not slovenly, so elastic that it will embrace anything, solemn, slight or beautiful that comes into my mind. I should like it to resemble some deep old desk, or capacious hold-all, in which one flings a mass of odds and ends without looking them through.
Once the pen is running on the page, it becomes much easier to hop the fence into a story or poem, whereas if I’m swimming around in my head, that fence is much taller. (It’s hard to hop a fence if you’re swimming, right? I suppose the geniuses are the flying fish.) I’ve found this to be true whether I’m writing or doodling, but I’ll make the case for doodling another time, perhaps with this for support.

Lilli Carre is a writer/illustrator who put together a bizarre little animation about losing your head called Head Garden. I love the style and the metaphor. Check it out.

That same old friend who suggested this Brautigan poem suggested another new something: daily poetry updates from Rattle. Poetry, that complex web of carefully constructed meaning, is delicious, nutritious food for your brain, and an awesome way to take a short break and focus on something completely different. Give that mind a rest, and set your subconscious free. You can sign up in the upper right corner of the Rattle website.

Some (most) would say I read too much about writing, and don’t do enough of the real thing. I’m working on it. Until then, I started another book, The War of Art by Stephen Pressfield. In it, he outlines the most evil force in the universe, Resistance. Resistance is that which prevents us from doing our work, the work were meant to do, whether it’s creative or entrepreneurial or some other vocation. When we submit to it, we end up doing unhappy work, leading only to terrible things. Resistance lives on fear, it makes our excuses for us, it high-fives Rationalization and tells us we do need a break, that we can take the day off, and that the easy way out is the best way. He goes on to differentiate between professionals and amateurs in their craft, helping us avoid the mistakes of the amateurs. The amateurs worship their work and define themselves by it (and the assumed glory). The pro shows up for work every day, no matter what, battling Resistance anew every moment of the way.

Defeating Resistance is like giving birth. It seems absolutely impossible until you remember that women have been pulling it off successfully, with support and without, for fifty million years.
Pressfield talks about how we can use Resistance and fear as a compass to determine just what direction we should be going in our lives. If we feel the resistance, that reveals the path. If we have a great fear of something, that’s the best reason to conquer it. Be wary of rationalization, and the excuses it can lead to. Make choices, not excuses. Dive in head first. A great quote from John M. Mitchell:
The finest steel has to go through the hottest fire.
And now, I have no more excuses, and must get back to actually writing.

The Waldy's girl

Is there a rule about asking a girl out while she’s working? Romantic-comedies make me sick, so if there’s a rule, someone needs to tell me.

She’s pretty and nice, and the pizza here is really good. I asked.

She said no, she has a boyfriend. Which is fine. I’m terrified of commitment and pretty busy anyway and thanks for everything and see you around and oh crap I already paid for the pizza.

Now, Lovefool is blaring. I’m the only customer in the restaurant, and I just asked the girl at the register if I could buy her coffee.

Front-end dev, UXMas, 3D Printing, TL;DR, HackDesign

A few months ago I found a great overview of tools for Front-end Developers. It’s pretty link-heavy, but contains a lot of great information for anyone (like me) looking to go from kinda, sorta developer to Fully-On Nerd-Alert Developer Central. If you’re not exactly there but interested, it might be a good to see just what the hell we’re always talking about. Most recently, I’m getting a hang of Javascript, Github, and the command line, and I’m looking forward to trying some CSS preprocessing with LESS and/or SASS.

Last month, a beautiful little advent calendar went up at UXMas, along with 24 great articles about User Experience Design. They are pretty solid so far (I have a few left) and I recommend the mp3 effect and this Zen and the Art of UX the most, though I feel the User Experience of Wine might interest the majority of you.

The mp3 effect article I mentioned raises an interesting point about 3D printing that hit me like a wall last week. Within the next 5 or 10 years, we will see a massive rise of affordable 3d printers and 3d printing material. We will download artsy little blueprints online, and send them to our printers before tonight’s dinner, and we will be able to completely customize our own coffee mugs in the comfort of our own home. One thing to keep in mind, and the point of the article: as with the mp3, convenience comes at the cost of quality.

“TL;DR” is, to me, a reference to college text books. This site, toolong-didntread, gives complete news stories in about 3 sentences, and covers every major topic. And just look at that design! You can’t mouse over that menu without at least a little bit of subconscious euphoria.

From that design reference, a segway to another one: HackDesign.org is putting on a free design crash course for hackers. For you internet illiterate, these days, ‘hack’ really just means ‘throw together in a short amount of time, but in a programmy-, web-sense’ and ‘design’ means ‘make things that are well thought-out that also look like they are well thought-out.’ I’m excited to see what the course has to offer.

Mind-control

Story idea: guy who can make people go away, just by writing about them.

Later, he learns the trick, and can do it by talking at or about them.

Still later, all he has to do is think, and they’ll drift onwards, elsewhere.

It’s a good story, and there are problems and conflicts. He has trouble controlling his thoughts. He thinks about whatever’s in sight, and soon, everyone he sees is a surprise person that he has never thought of before.

Not long after, they too are driven away.

I suppose he just dies alone. Or stops thinking so much.

Fiction is good for you, some life advice, an amazing poem, and honesty

This just in! (10 months ago) this article explained how good fiction is for our brains. In a nutshell, we get to practice real life in our heads, and therefore get better at it, or at least more flexible and accepting of new situations. So, if you read alot of Sci-Fi, in the near-future, you will be just a little bit more helpful to have around than these hordes of Fantasy nerds.

Quora is a great website to find well thought-out answers to somewhat open-ended questions. One question asks about pursuing a high-paying corporate job or a low-paying passion. Another asks about high-leverage activities that ensure a good life. This is part of the answer:

I believe that any advantage I might appear to have in computational ability, imagination, perceptiveness and expressiveness- ALL OF IT is a consequence of the vast amounts of reading I did as a child. Reading expands your mind. It gives you new and interesting perspectives to work with. Reading exercises the mind, it gives you new possibilities, it allows you to learn from the minds of others.

I believe that the benefits of reading have compounded effects- when you have had your mind expanded, you approach the rest of life with a more open mind, you’re more perceptive to little details, you pay more attention, you get more out of every subsequent experience. This compounding never truly goes away.

You’re never to late to start, and don’t feel like you should ever stop!

Also, I would absolutely add writing to the top of that list. Also also, the topic of life advice reminds me of this post (from brainpickings, again) in which Alan Watts tells us how to figure out what to do with our lives.

An old friend recommended a new poet (Richard Brautigan) and his poems recently, and I rather enjoyed The Galilee Hitch-Hiker. He may be an old, dead hippie, but he made me laugh and smile and sad all in one. Here’s an excerpt:

The Flowerburgers Part 4

Baudelaire opened up a hamburger stand in San Fransisco, but he put flowers between the buns. People would come in and say, “Give me a hamburger with plenty of onions on it.” Baudelaire would give them a flowerburger instead and the people would say, “What kind of a hamburger stand

is this?”

I also picked up a new book because I judged it by its cover and loved the title: Sloane Crosley’s I Was Told There’d Be Cake. It’s fantastic. The writing here is more essay-ish, or maybe more journal-y, than story, and it’s something I’m trying in my own writing lately. It may be easier to say something honest when I don’t have to create and find characters, but just pull experiences and thoughts together and try to make sense of it.

If you see this one in the bookstore, at least read the first one. It’ll make your day.

Stacking the deck

I wish I could stack the deck on my commute.

People who are lucky – their lives play out like stacked decks. All express stops to the next purple.

My little sister used to stack the deck in Candy Land, which was totally fine. We’re 9 years apart, and I didn’t really want to play anyway. ‘If we could wrap this whole thing up in about five minutes, that’d be great. Winner cleans up.’

You can be lucky too, if you want. Or, at least appear to be. Reset your expectations and realign your goals based on the most recent results.

Philip Seymour Hoffman is a good actor even in writing

I was riding the train and thinking too much, when I realized the man sitting next to me was Phillip Seymour Hoffman, old as death, like at the end of Synecdoche, holding a manuscript, and crying a little.

I eyed him in the reflections and stared out the corner of my eye. He heaved silent sobs.

“Philip?” I asked. “Jaden?” (His name in Synecdoche).

He looked at me, almost spoke, frowned, and shook his head. 

The next stop was mine, and I got off, but I feel like I should have stayed with him, just a stop or two longer.

Peace of mind

Says one side: “Anything designed to kill and be concealed should be illegal.”

Says the other: “The state has no right to limit the self-defense of its citizens.”

Years later: Things are mostly the same. Self-defense has reached an all-time high. We’ve got four nuclear warheads in the kitchen, next to the stove. We’re careful not to bump into them. My wife doesn’t like them, but that’s a low price for peace of mind. A new set is being installed in every classroom at school next month. I sleep much better knowing they are there.

You know, just in case.

Dear Christy or Kristy or Cristie or Kristie in SoHo

Dear Christy or Kristy or Cristie or Kristie in SoHo,

You said my name was old school. I appreciate it. Old school sounds so cool. Chucks, short-shorts, Magic Johnson.

Is it stupid to think that I’ll see you again, in a city with so many people?

Fate does not approach the passive, and random chance is totally random.

But a city with this many people has got to have some magic. People pass thoughts and moods along, from one apartment to another. Extra-sensory ebb and flow from Brooklyn to SoHo.

Our good-bye was like a hello. Thanks for your name. 

Gamification in a nutshell and gaming to save the real world

Gamification has been infiltrating websites, apps, and user experiences everywhere for several years. So what is it?

Gamification is the use of gaming elements in non-gaming experiences. The goal is usually to make things seem more fun or more productive. Subtle progress bars and points systems encourage you to keep going, while achievements and badges reward your brain for ‘winning.’ When done right, it works well, increasing conversions and adherence.

Well-designed gamification can be very effective, and poorly designed gamification can be very flat. I think, in general, it is important to keep a focus on meaning and content. Don’t reward meaningless tasks, and don’t provide content as a reward unless it is well-thought out and worthwhile.

Good gamifcation examples include FourSquare’s ‘Mayorships’, Codecademy’s badges and progress bars, and just about all of Khan Academy and Lumosity. Simulators and educational training tools are the perfect medium for gamified experience, and the future of education. Videogame addiction is an example of gamification being (perhaps too) successful, via the incredibly detailed breakdown and balance of achievements and rewards in games like Call of Duty or World of Warcraft.

In this incredible TED talk, Jane McGonigal talks about how gaming can save the world. She describes the concentration, intensity, and sense of urgency that gamers achieve when problem solving. McGonigal has a dream: she believes we can transform gaming problem-solving into real world problem-solving. Gaming often brings out the hardest-working, fastest-thinking, and most selfless version of ourselves. For more on harnessing the power of our brains on games, check out McGonigal’s book: Reality is Breaking.

An amazing example of gaming for the world is FoldIt. FoldIt is a game about protein folding that applies real-world physics, biology, and chemistry to interactive molecules. Players are challenged to find the lowest-energy state of the molecule, and gain points as more energy is released (due to changes in the orientation of the molecules). The project has a huge success story, as a team of players was able to find a piece of a puzzle that scientists started looking for over 10 years ago. Start solving puzzles for science here.

Prompts, that precious writing time, so you want to be a writer

Happy Holidays to everyone, and a happy new year! I pulled in a good haul for Christmas: new stories by authors I’ve never touched (Ray Vukcevich, Nikolai Gogol, and William Trevor), one from each of my Big Three (Etgar Keret, Kurt Vonnegut, and Neil Gaiman), Writer with a Day Job by Aine Greaney and Best American Nonrequired Reading edited by Dave Eggers.

Finding that time to write becomes even more difficult for me during the holidays, when my super-busy-with-work mindset switches to an even-busier-with-family one. I’ve been taking twenty minutes before bed every few days to record as many of the events and interactions as possible, a writing/journaling habit that I’ve practiced for the last three years.

But journaling is not the same as writing. It’s close, and sometimes it spills over, but isn’t the same as sitting down and writing a story. You need separation, the time, the blank word doc or piece of paper ready to be shaped into something worth looking at, worth showing.

If you’re looking for somewhere to start writing, I’ve been getting prompts from Figment.com for a few weeks now, I highly recommend them. They are unique and always spark an idea in my head. You can sign up here.

It’s the end of another year, and a good time to look back at how far you’ve come. As a writer (or developer, or anything), it sometimes feels like I’m not growing at all, like I’m not putting in enough time or paying enough attention to really grow. It’s important to compare yourself to where you were two weeks ago, a month ago, 6 months ago, last year, etc. Growth happens in tiny little itty bitty increments, and the changes become visible only as time passes. Don’t be too hard on yourself if you’re not writing as much as you want to or could be. If you really want to do it, do it.

There is a poem by Charles Bukowski (via BrainPickings) called So You Want To Be A Writer. (Watch the reading of the poem on YouTube.)  In it, Bukowski tells us all the reasons we should NOT write (or do anything creative/artistic). I sometimes find this discouraging, mostly because of the self-doubt that plagues my inner-writer. But there is another perspective. In the end, Bukowski tells us:

when it is truly time, and if you have been chosen, it will do it by itself and it will keep on doing it until you die or it dies in you.
These lines seem to take some of the pressure off. Be ready for it when it is ‘truly time,’ and don’t let it die in you.

Write, now and always. Until it’s ready to do it by itself, keep practicing.

Everybody write, everybody draw, now

Maria Popova, of my favorite blog/website, BrainPickings.org, has a tumblr that matches up music with well-chosen excerpts from books. I really liked this one. Especially the last part, which comes from Debbie Millman:

“If you imagine less, less will be what you undoubtedly deserve. Do what you love, and don’t stop until you get what you love. Work as hard as you can, imagine immensities, don’t compromise, and don’t waste time. Start now. Not 20 years from now, not two weeks from now. Now.”
DO IT.

Let your imagination run wild! Write whatever you want, draw whatever you want, and love whatever you make. And I mean “love” not in the yeah-I-like-it-a-really-really-lot kind of way, but in the caring, attentive, thoughtful, and emotionally intelligent way relationships should be.

Drawing and writing stories and playing make-believe isn’t stuff kids do because it’s easy, it’s something they do because their imaginations haven’t been silenced by the self-conscious censors of society.

And take a look at my brother’s doodle on the subject.

This could happen to you: You come back from a night out with your friends, and when you get back to your apartment, you lay down on top of the piles of laundry all over your floor with a good book, ready to knock out a short story. You dive in, probably reading Vonnegut’s The Kid Nobody Could Handle, trying to imagine the band conductor drinking coffee in a diner while watching machines tear down some beautiful nature for a strip mall. It’s a bit murky, and you can’t figure out why you aren’t following it. Then you realize why. Inspiration. Your subconscious floated a beast of a story into your conscious mind, something you HAVE to write.

Here’s the kicker: YOU NEED TO WRITE THAT STORY RIGHT NOW.

Just spill. Let it go. Think of nothing else. Just write it. Your options: 1) go to bed. Nothing happens. Whatever ideas you have are still stuck in the pre-writing phase, and thus are still relatively useless or in the same place tomorrow when you sit down to write. 2) You write for 20 minutes, and the next morning, you look back on your scraps and laugh about how ill-formed they are. Over the course of the day, you have a number of thoughts related to what you spilled, and the beginnings of an arc are formed.

My advice is basically this: get through that plot point that is in your head As Soon As Possible. Good stories are about change, but you can’t write change from A to B until you’ve written A, and you won’t have the best idea for B until the tone/idea of A has been fully-formed and executed.

Put a bend in that narrative arc, now. Let it evolve tomorrow. Get it? Write. If you get stuck, doodle.

UPDATE: Just found this, a write up of Gaiman’s response to a question from the forum two weeks ago.

What is UX Design? (In the context of web/app design)

To talk about User Experience Design, we have to first talk about User Experience. So…

What is user experience (UX)?

User experience (UX) is the way a user feels about using something. Feels, an emotional reaction that occurs during the use of the product. A good user experience is often satisfaction and pleasure, and a poor UX can range from annoyance to frustration.

User experience is determined by a number of factors (thanks, Wikipedia):

  • The product, service, or system itself (functionality, interface, brand, etc.)
  • The state and previous experience of the user (mood, expectations, motivation, know-how, etc.)
  • The context they are using the product in (i.e. location, time limitations, available hardware, available hands, etc.)
These things all come into play in determining User experience, and therefore are heavily considered in UX Design.

So, from there: UX Design is the design of user experiences.

Let’s get down to the practical, web-design-specific details. UX Design is a bit of an umbrella term. Wikipedia broke it down into discernible parts, and I’m going to borrow from that for these 4:

Visual Design

Ah yeah, this is the good stuff. Aka: User Interface (UI) Design, or even (broader) graphic design. It’s not just about the graphic treatment of the interface elements, but about conveying a consistent message with typography, color, images, and symbols.

Information Architecture

Yep, it’s back. Refresher from the last post: Information Architecture is all about structure and organization for the sake of findability and usability. IAs want every single step in a process to make sense, and focus heavily on information and its presentation.

Interaction Design

Interaction Design is one step away from IA toward Visual Design, but maintains a direct focus on user goals. Of importance are the layout and emphasis on pertinent information and visual cues. It takes into account available user behaviors (ex. drag-drop, mouse-over, etc.) and overall consistency.

Usability

There’s just no escaping this guy. Usability asks one question: Does the product effectively do what it is intended to do, for both the user and the manufacturer. Usability is LIEK SEW IMPORTANT to a good user experience.


UX Design is a highly-multidisciplinary field, which may be what draws me to it. UX Designers spend time thinking about psychology, anthropology, architecture, sociology, computer science, graphic design, industrial design, cognitive science…. whatever field their clients happen to be working in…throw marketing and strategy in there, and you’ve got the Thanksgiving Dinner of career paths.

If you’re interested in the theoretical history of UX Design, I recommend starting in Human-Computer Interaction (HCI). Yes, that is another acronym, but it may interest you. I don’t know why. I don’t ask questions.

What is Information Architecture?

Information Architecture is a relatively new part of web development (as compared to, say, responsive design), and something that may be foreign and annoying to any website stakeholders. What do these guys do, anyway? Why do we need one? I will tell you up front that, unless this is a one or two page website, you DO need one. Planning is a HUGELY important part of any website, and getting it right before the design phase will save you boatloads of money in development.

Now then, onto the good stuff.

According to the internet, Information Architecture… has many definitions. Wikipedia has five. In an effort to keep it concise:

[Within the context of web design,] Information Architecture is the organization and labeling of information to support usability.

Information Architects want the website to make logical, informational sense to the user. They are concerned with getting the right information in the right place at the right time. If the IA is good enough, a user won’t even realize they are navigating a structure, as the content will flow smoothly and logically from start to finish. As a result, good information architecture is largely invisible.

IAs come from multidisciplinary roles, as they need to be familiar with a variety of skills and technologies. They work closely with the stakeholders responsible for the site (the project owners, managers, graphic designers, developers, writers, users, etc.). The IA focuses on the end goal of the user, and works to keep the moving pieces aligned with this goal.

Ok… so what do they do?

In the grand scheme of web development, Information Architects focus on the big picture. They can be compared to city planners: they have to know how everything works, but they don’t have to know how to do everything.

So what do they do?

  1. Research. IAs study everything, especially the content and the users. They get to know the project, the primary endpoints of the stakeholders, the target audience, and how they communicate. In larger projects, this step could include interviews, focus groups, polls, usability tests, etc.
  2. Analysis. IAs put everything together and (attempt to) simplify it. They layout the steps in between now and the achievement of the project’s biggest goal. They also generate personas and scenarios (fictitious user personalities) to represent the segments of the target audience.
  3. Blueprints. Like an architect, IAs put together the blueprints of the website or app, typically with a site map and wireframes. The blueprints do not limit the art, web design, or copy of the site. They layout the key labels, navigation, and structure that the content will fit into.
  4. Overall direction. Once construction begins, the architect is responsible for maintaining the right direction. IAs do this through personal feedback, but it is also important to test users early and often.
Wikipedia reported some debate about whether or not Information Architecture is limited to the organization of information or if it covers usability as well. I think, in a practical sense, Information Architects working on web and mobile projects should always keep usability top-of-mind anyway, regardless of its categorization.

Next week, one of my favorite things: What is UX Design?

Vision and Brilliance at the Connecticut Forum

A very special friend of mine got me a ticket to the Connecticut Forum’s Vision & Brilliance last weekend. The talk was nothing short of mind-blowing. I made a weekend out of it (visiting Hartford for the first time) and did lots of note-taking and writing. The result is a bit of an organizational issue, but I’ve done my best to share as much as I could without being too overwhelming.

The forum’s host, John Dankosky of WNPR’s Where We Live, correctly defined the night as an “awesome nerd-fest.” He said it’s never wrong to ask stupid questions, and tonight he’d have no trouble with that. The forum consisted of Neil deGrasse TysonNeri Oxman, and Neil Gaiman, who in a nutshell represent Science/Astrophysics, Art/Design, and Imagination/Writing, or, if you’ll allow me, Past, Present, Future.

I wrote down as much as I possibly could, and have collected and tried to organize it all here. Each section below is my attempt to summarize and paraphrase the (many) key points of the event.

Neil deGrasse Tyson sees himself as the world’s most popular astrophysicist, which is basically true. He has 3 of the top 10 Reddit AMA (Ask Me Anything) Threads of all time and a very popular Twitter Account. Tyson says it is his life’s work to “Bring the Universe down to earth.” He has perfected his sound bytes, which tie perfectly into the current attention span of the internet.

Tyson is extremely passionate about his work (along with Gaiman and Oxman). Here is an amazing (10 minute) lecture he gave on his passion back in ‘06, that gives you a sense of his charisma and love for the Universe, as well as why he feels large rather than small when he looks up.

Tyson talked about this at the forum too. Like Carl Sagan said we were Star Stuff, Tyson says we are Star Dust. Literally, every atom, every molecule in our bodies came from another start, millions (Is that the right scale?) of years ago. We are made up of dust from the stars, and, in the time since then, we’ve evolved enough to ACTUALLY FIGURE THAT OUT. We are so large, and we look out into space. When we look up and wonder about it, we are wondering about ourselves. We should be very proud and stand tall. We have come so far.

Other points Tyson made:

  • It is empirically false that we need to be religious to be moral.
  • On design: people say nature is beautiful, but is it really? We can now design better than nature.
  • Science’s progress can be defined by our creation of tools that are not even a part of our senses. Example: our ability to detect the ultraviolet and X-Ray wavelengths of light. We have extraordinary sensory powers, due to science. Nature is a limitation on the truly creative mind.
  • The idea of finding ‘other’ intelligent life is audacious and ridiculous. It implies that we ourselves are intelligent. Look at our almost genetic equals, the ape. They are only as smart as our toddlers. Imagine the beings that are one step genetically beyond us, assuming other beings have evolved in the same way. We would be insignificant. [Gaiman note: “I’d still trust the chimp to outlive the naked human in the woods.”]
  • For a positive spin, we have a powerful tool: the collective human intelligence. We don’t have to discover and define fire, or physics, or language with every new life. We are teaching ourselves to learn it faster and in better ways. [Gaiman note: “We are standing on the shoulders of giants.”]
Neri Oxman is studying, practicing, and teaching form-finding at MIT’s Media Lab. She is beautiful and brilliant; it was wonderful to see Tyson gawk (or is it balk?) at the things she was saying. Given how complex her ideas were, she did a wonderful job of articulating them. Here is an excellent (20 minute) lecture she gave that I could not look away from.

Oxman says we are in the eye of a hurricane: we are between the industrial revolution and a new way of thinking about “making.” She talked about how design is changing from designing a form directly to designing a process to create a form. She is studying nature and it’s methods for “making” (bones changing in different gravities, glowworm silk that is stronger than steel, etc.), and applying it to other processes. Some of what she is doing has to do with modifying/designing constraints under which processes take place.

For me, this stuff was mind-blowing. The MIT Media Lab is bringing together imaginative designers, materials science engineers (among other engineers/scientists), and computer programmers to push the frontier of “making.” Oxman also talked about going back to look at the history of design, especially bringing a design perspective to ancient mythologies (Ex: the wings of Icarus).

Here are some more points Oxman made:

  • Rather than a problem solver, she pushes herself to be a “Problem Seeker.”
  • Art informs our experience of the world, especially on an emotional level. It can be an emotional connection between members of humanity, connected across time.
  • Vision and brilliance is: Condensing an expression to bring about a thought or idea that we didn’t know existed.
  • The story of design is the story of augmented human power.
  • 3D printing: Wake Forrest can now 3D printed cartilage. Oxman believes we will soon be 3D printing buildings.
  • Oxman went on to talk about the future of design and making: 4D printing. How can we design objects and materials to change over time, depending on their environment, for our benefit? She also talked about the current downsides of 3d printing: Wasted negative space, the fact that nature doesn’t produce in perfect cartesian layers the way printers and computers currently “think.”
  • Harvard has a lung on a chip, for drug testing. Can we develop a human on a chip?
  • Never, ever lose that sense of a beginner’s mind in what you are doing.
Neil Gaiman is one of my very very favorite writers. He wrote the first graphic novel to be a New York Times Bestseller. He has written short fiction, novels, comic books, graphic novels, films, TV Shows, pretty much everything. My favorite book by him is a collection of stories: Smoke and Mirrors.

On stage, as on the page, Gaiman is a storyteller. He talked about wanting to be a writer since he was a kid, then corrected himself, saying it was too much work. Really, he wanted to have written The Lord of the Rings.

He tells all writers to keep writing. He cursed the publishers who turned down his early manuscripts, but, looking back, is very grateful to them. They saved him the embarrassment of having to hunt down every printed copy and burn it. He quoted Ray Bradbury’s idea that everyone is full of 1 million crappy words, and once you get them out, you’re fine.

After being repeatedly rejected, he decided to become a journalist overnight. He wanted to be published, so he journaled about publishing. A brilliant idea.

Gaiman talked about where stories come from. He said writers hate to be asked where their ideas come from, and typically respond with a mean, sarcastic lie, because we don’t have any idea. He said stories come from the confluence of two ideas. You daydream, and let your mind wonder and wander, and when two ideas come close, there they are, and there’s the story. He talked about gazing up at the stars and just thinking, something Tyson was happy to hear about. [“The Universe called you, Neil,” in reference to the inspiration for Gaiman’s novel: Stardust]

He also talked about the importance of reading and imagining. At a convention for science fiction in a China, engineers wondered why they were making so many things that were being designed elsewhere. After looking into it, the Chinese engineers found that many of the engineers that were designing (rather than producing) had read fiction as children, especially science fiction. Reading fiction is so important! It boosts your imagination, which makes a creative difference in innovation, among other things.

Big points made as a group:

Do what you love and love what you do! Obvious but also VERY important.

Tyson: when you really, truly love it, you’ll sometimes work to the exclusion of personal hygiene. And then your friends ask you about vacation. Vacation? From what I love? They don’t understand. Also, Listen and be Persistent: How much brilliance has been lost due to lack of listening (on one side) or lack of persistence (on the other)?

Gaiman told a story about a girl who wanted to be a director, who was discouraged because there are many directors already. Gaiman: Yes, but there is only one YOU. You are the ONLY one who can bring your personal vision and creativity to the world. [See 1:57 of this for the whole thing.]

Talk of geniuses.

An intersting point about Picasso and Einstein. They were contemporaries, and between Cubism and Relativity, they were really talking about the same thing: the juxtaposition of space and time. WHAT!? Yes.

Talk of Newton’s supreme intellectual curiosity and Michelangelo’s vision: releasing the prisoners from the blocks.

Talk of the growing cumulative human intellect, as aided by writing, sparked a concept in my head of everyone’s personal cumulative intellect: a collection of one’s thoughts, work, and writing. This is related to another idea that I believe in: writing as learning. When you sit down to write something, you force yourself to articulate what you think it is, and it is etched into your brain, giving you a much more thorough understanding of it. It’s not always about the output of writing (i.e. the document or the blog post) as much as the idea itself and it’s depth in your mind.

On the apocalypse. 

Tyson: sign over your friends’ assets to yourself before the 21st. The idea of the “end of the earth” is hubristic; the earth will survive, it’s human life we have to worry about. An asteroid will certainly one day come for us. Until then, we’ll be watching the skies.

Who’d you want to be for a day?

Tyson: Isaac Newton. Look at everything he did BEFORE he was 26.

Gaiman: The man living next door to John Wilmot, a great Restoration Poet who was also continually drunk and philandering.

Oxman: A tree. And it wasn’t a joke, I don’t think.

Exit interviews:

Tyson on bringing together a collision of ideas to produce something greater than the parts.

Oxman on the importance of sharing information as a group to create knowledge.

Gaiman on de-mythologizing the creative process.

This was a bit long, and not quite exactly about writing, but definitely about Getting It Write, and, I think, worth anyone’s attention.

Someone tell H.G. Wells

Sometimes you walk into a room, or a restaurant, and you’re the only one there, and suddenly the moment steps outside of time. You hold your breath and your brain and watch are on hold.

That’s where I found The Time Traveler. He was eating an Italian sub on the Lower East Side on a Saturday night.

I watched him while I ordered. He didn’t do much. He watched the roaming packs, taking notes in a tiny little book.

I had to ask. “Time Traveler, what are you doing here?”

He thought for a moment, then said. “Pausing, between worlds.”

A ghost, I think

I passed the old house, very late one night, on a walk with the dog (tiny, useless in a fight). She wasn’t a ghost, or violent, and the spooky creak of the trees didn’t sound exactly like her fists slamming against the door. But it was close, and, at that moment, I preferred a bigger dog.

The story was: the deficient young girl had been locked out by mistake. She wailed through to dawn. No one moved. Her parents slept with earplugs. The next morning’s scene is still a neighborhood secret.

It’s much scarier when you don’t know the truth.

Barack Obama is my new girlfriend's crazy ex-boyfriend

There we are, watching the debate, eating gummy worms and pickles, considering highly important matters of national attention, when I find out.

She forgot to tell me, she says. It’s not that big of a deal, she says.

Later, the debate rages on in my head. I’ll vote or die or whatever, although I don’t feel super confident one way or the other. The polling questions are now annoyingly complicated.

I didn’t ask why they broke up, or what Miranda thought. That’s her name, right? Miranda?

Anyway, it’s been fine since then, I guess. A little weird, but mostly fine.

Pay attention to the words

I started Francine Prose’s Reading Like a Writer last week. I think it’s an important one to learn from early, before jumping into a slew of the others. Of course, I just started Neil Gaiman and Terry Pratchett’s Good Omens yesterday, and am loving it. Is it too much to read 4 books at a time? I’ll have to make sure I don’t let any of them slip through the cracks.

Prose made some points that I liked and hadn’t heard before, that I will paraphrase here. She tells readers to slow down, rather than speed up through all the classics. Pay attention to the words! Remember that every page started blank, and every word was at one point debated and chosen. The words are like the notes of the musician, like the brush strokes of the painter. Great imagery. She also encouraged a focus on the classics. Not that we shouldn’t read modern lit, but that we have to know it’s the end of “the extremely complicated sentence that is literature.”

This is pushing me to think about what I’m doing, and where I’m taking myself. We are all essentially a compilation of what we expose ourselves too (the difference of course being how we perceive and manipulate that input), so whatever I pursue will shape me. Another thought I had was: shouldn’t it be just as important to read bad literature as good? I want that to be true, but I’m not 100% sure it is.

Anyway, I’m very excited to attend this event tonight, and can’t wait to report back with the details.

Damn you, inspiration!

Inspiration comes in the night.

It’s where I look, where you might 

find

me tumbling along a crooked road

bartering unmatched socks with a toad 

who

soaked his pair in the pond, on the pad

then hopped upfor a lad

to

trade in the shade, with a smirk.

but this switch made no jerk

be

cause (in this dream) I love unmatched socks

so much I’d hand this toad flocks of rocks

with-

gold-flecked dots and mushroom-

shaped spots, fit for a groom,

out

on his day (or her’s), or any day.

perhaps to-day, butreally,

first.

i go to bed.

5 Useful Dev Tools and Where I'm Diving Lately

Happy Thanksgiving everyone! Here’s what I’ve found useful in the last few weeks.

For anyone making web color scheme decisions, the Color Scheme Designer lets you pick a number of colors and includes “Light” and “Dark” layout examples right on the site.

UI-Cloud is a search engine full of User Interface elements. Pretty amazing if you’re looking for inspiration or an idea of what other people are doing.

Swiffy is a Flash Professional add-on that allows you to output most Flash .swfs as HTML, CSS, and JavaScript. It’s super easy and powerful, and lately has saved a lot of development time on interactive pieces.

Mixpanel is an online analytics platform with event-based listeners available for integration with basically everything it should (Javascript, iPhone, Android, ActionScript, Python, PHP, Ruby). It is simple to implement (so far) and I’m hoping it’s easy to organize.

I had an issue implementing jQuery UI touches on Mobile Safari on the iPad last week, but I found a nice solution: Touch Punch is a plug-in that converts (most? all?) touches to clicks. A cleverer or less-busy developer might be able to apply this solution to other issues.

The last few weeks, I’ve been taking strides toward becoming a well-rounded developer. I’ve been diving into the proper use of GitHub and learning the ropes of codebase version control through git and svn. This has necessitated a barely-working knowledge of the dreaded Terminal and the beginnings of Vim. I need to learn all of these things quickly and properly, and, as always, the best way to do that is to dive in. So, I’ll sink or swim, and let you know what resources I find along the way.

What writing can do for you, too much to read, and a nano-sized delay

Last things first. My work plus work I’m doing outside of work plus Thanksgiving came up and bit my NaNoWriMo novel write on the neck, at which point it bled out, died, came back to life, saw the blood, passed out, woke up, ran away, and has been hiding in a cave somewhere in Fort Greene ever since. So I’m working on coaxing it out of there with candy, pens, and blank notebooks scattered around the park. I’ve convinced myself that the 50k word limit is an excellent goal for the end of the year, and I swear on my life that a coffee-induced December will be the extremely writerly-productive.

Quickly now, before you realize I’m writing this instead of doing 2,000 other things on my list: I’ve officially hit a limit on book purchases. With the additions of Margaret Atwood and Milan Kundera (as recommended by this Power of the Introverts TED Talk) and two Bukowski’s, my 4 book shelves are full. There’s just no more room. I did a count, and at 3 books per month (already asking too much for me) I’ll have them all read in about 4 years. So I’m going to be saving money on books for a while. I would say my eyes are bigger than my stomach, or brain, but neither really makes sense, because you don’t really eat books (not raw, anyway), and because that doctor in Synecdoche, New York said the eyes are part of the brain, even though it just doesn’t seem right, or accurate.

Happy Belated Thanksgiving! The holidays are a good and strange time. You take a step back and think about last years and forever ago’s Thanksgivings. You get some perspective on where you’ve been and where you are going. It’s not too different from writing. Writing gives you a fresh perspective, a chance to see things in many different lights. You notice little things and see if they fit in somewhere else, or if someone’s minute body language has broader implications, or if, just maybe, this is the setting where the aliens can make their plausible entrance into your story.

Bird By Bird and writing prompts everywhere encourage writers to dive into their past and figure out what went on. This weekend I remembered a story from when I was 6, at the grocery store. I wanted gum from the mass of candy at the cash register. My parents said no, put it back. I put it in my pocket. BOOM. Master Jewel Thief, in training. We got home and I ate most of a pack of Bubblicious in about 20 minutes, secretly, guiltily, alone in the basement. Later my parents asked where I got that (probably gigantic wad of) gum, and I was toast. They took me back to the store, where I had to apologize in person to the manager and pay him back. It was terrifying, but I was pretty good after that, I think. Unless there’s more to unearth somewhere. We’ll have to see.

Delusions of Grandeur, a Moment in Character, Emotional Acres

I AM TOTALLY COMPLETELY IN LOVE WITH MY NOVEL! I’ve never liked writing a story as much as this. It should be noted that I’m only 4k words in. WAY behind by NaNoWriMo standards. I started late because I wanted to get farther along with my planning, and I’m glad I did. I’m hoping to catch up to 50k, but I’m more worried about getting it write than hitting that number by December.

I’ve written from outlines before, but this one is something I’m finally excited to write and tell people about. This is why I always advise going crazy and telling the story you want to tell. I’m having so much fun.

My head is inflated, and I’m sure as I dig into the next few weeks, I will struggle and suffer mightily. Until then, here’s a character moment I had two nights ago.

I was frustrated because one of my characters (Lily) was becoming increasingly 0ne dimensional. She was a throw away character, one that was supposed to simply disrupt a marriage, like Mars crashing into the Earth and spitting up the Moon. But it was fake. It was easy. She was a faceless Southern Belle, and there was no depth.

I didn’t know what to do, so I started playing with other dimensions to add to her character, or other versions of her story. Then I had a moment. This may seem obvious, but it is a rule I will try to maintain through all my writing:

Characters are not just details. Every character has his/her own story. 

Stories are about change. Change is so good and necessary in stories (and life). Every character has an arc.

I had to figure out Lily’s story. Who is she? Where’d she come from? Where is she going? Lily plays perfectly into another role I have been planning for later on in the novel, and connecting those dots formed a beautiful arc: Lily’s arc. I like her so much more than the couple I thought I was writing about. Hello, Lily, it’s wonderful to have you. I am very pleased to have stumbled upon her story, and happy she could show me the way.

I just started Anne Lamott’s Bird by Bird. She talks about character development in terms of an “emotional acre.” The idea is that everyone has an emotional acre of land, on which we can do whatever we want. We could build a house or a pool or a junkyard or grow banana trees or play skeeball. My emotional acre would be covered with books and video games, electronic music, trampolines, a basketball hoop, family, friends. It’d have amazing WiFi and too many posters. Everyone would be jealous.

Lamott says we need to get to know our characters’ emotional acres. They start out simple, but they develop as you get a sense for what he/she holds dear and values emotionally. Framed pictures of children. A stuffed animal from childhood. She uses another visual metaphor, a polaroid picture, to talk about how they come into focus as we think, plan, or write about them.

One last piece of NaNoWriMo advice. Get off the internet and write! And check out these other tips.

Good luck with your writing. I’m getting back to mine.

Tools that taught me to code

I’m not an advanced developer by any means (in fact, my title is “Junior Developer”). But I think I’m in a good position to look back and see what helped me reach this level, and share some of the more useful tools for anyone looking to get started building websites and apps.

A note on teaching yourself. My development experience has been largely self-taught, meaning, I sat down by myself and toyed with this stuff for hours, googling around for answers, following tutorials, and just hitting Run over 9000 times until the program did what I wanted it to. THIS IS SO IMPORTANT. The best way for me to learn was to plug my nose and jump into the deep end, keeping my eyes painfully open for keywords. Learn how to use Google, learn to always click on the StackOverFlow answer, read alot, try alot, take breaks, but keep at it.

The human element. Find peers and learn from them. If you put all this time in on your own, you will improve by leaps and bounds every time you meet with other real-life developers. Ask them what tools they learned from, what text-editor they use (Sublime!), and what language they’d recommend getting into (necessary? growing? niche?). After months of programming on my own, I ran into a like-minded developer on a train, and just talking about it with him was a huge leap for my experience.

Read on the internet! This is advice for any career. Google it and absorb it! If you are interested in any topic and know nothing about it but are ready to dive in, read the whole wikipedia article. It will be so good for to have at least that level of background, even if you don’t know what it is all referring to. You’ll piece it together as you go, and have a great foundation for growth.

Now, to the tools.

  • Codecademy is a free tool for anyone getting started in programming, anyone curious about whether or not they’d like it, or anyone looking to quickly dive into a new language. As with any programming, if you’re starting from scratch, it can be slow moving early on (WATCH YOUR SYNTAX). But Codecademy works hard to pick you up from nothing and teach you some useful skills quickly. They now have weeks worth of courses for HTML/CSS, JavaScript, jQuery, Ruby, and Python. (Also, the whole experience is a great example of Gamification, which is slowly but surely taking over the internet.) Check out Codecademy. Even Mayor Bloomberg is doing it.
  • I mentioned Udemy last week. It’s a great tool for finding quality courses that will teach you pretty much anything. Not free, but sometimes paying a little bit of money for something will motivate you to actually do it. Like college.
  • TheNewBoston is where I originally learned what an HTML tag was, and how to apply a CSS property to it. I didn’t build anything pretty, but sometimes you just need the very basics, delivered exactly as that.
  • Getting over the Objective-C and Xcode hill was a big climb, and I remember when every Google search was turning up a certain EXTREMELY helpful website. RayWenderlich and his team (the men, the myths, the legends) are the best place to go for iPhone and iPad programming. They have very simple, well-explained, source-code-providing tutorials for everything from very basic apps to simple games to the latest iOS6 features. I’ve also bought their iOS5 and iOS6 By Tutorials books and vouch for both of them. P.S. I was just on his site, and the latest slew of posts look amazing. I wish there was more time in the day.
Other than that, I can’t stress the GOOGLE IT advice enough. Learn the keywords of your language, and put them in along with whatever method you think you might need, or just write out the whole question. StackOverFlow is an amazing resource. Don’t forget to add “tutorial” in there too. Often I’ll find a tutorial on how to build exactly the thing I’m struggling with. Programming these days, once you learn the syntax, seems to be about finding someone who’s already done the hard part. Now we make it pretty.

Email Subscriptions That I Actually Like

I hate getting spam, and I love Unsubscribing from email chains. In fact, I do it on an immediate, get-this-out-of-my-inbox-I-never-want-to-see-you-again basis. But there are some that make me just glow, and I thought I’d share the happier side of email with you guys. These are my favorites.

Webdesigner Depot’s monthly newsletter. The consistency of the great content in WD’s newsletter actually inspired this blog post. I recommend signing up as well as checking out the past issues. You can do both here.

10 Things You Need to Know This Morning. I found this through this IFTTT Recipe, but really it comes from Business Insider every weekday. It’s a wonderful daily tech-business review, and the IFTTT Recipe delivers the ten lines as text rather than images, which makes it a quick load and an informative, 30-second read (or more if you want to follow any of the links).

Udemy’s Course of the week. Udemy is a great place to take online courses that will teach you how to be whatever you want to be. I use it primarily for programming languages and the adobe creative suite, but it’s a great place to find quality tutorials for anything, at any learning level. The course of the week announced via email is discounted and usually enticing.

Smashing Newsletters. Bimonthly, and covering all that Smashing Magazine covers (Coding, Design, Mobile, Graphics, UX, Wordpress), these newsletters are great places to review the latest in web trends.

Of course, if you don’t like email or can’t wait for the next one, DesignFeeder.com aggregates RSS feeds from a variety of tech and web design sources.

Writing when you're stuck

NaNoWriMo started this week, and tens of thousands of writers are diving into their dream novels (or drafts thereof). This is a month of writing without thinking, blazing bravely forward and then finishing the junk that you started. It’s a month of fun and adventure and stress and hard-work. Early decisions can change the course of the story, and it’s not uncommon to write yourself into a high-walled corner. Writer’s block is a real thing. Don’t be discouraged!

Here are few things I like to do when I get stuck in my own writing.

Write what you love! In most of my writing decisions, I ask myself if the story I’m telling is one that I would love to read or hear myself. Is it something I’m excited to share? Is the next plot point ridiculous enough for me to love it? Ridiculousness is encouraged, especially during first drafts. If it’s too much, tone it back later. For now, just write!

Put on a hat! Be a superhero! I find that being weird while writing opens me up to being as crazy as I want. As I wrote here, being inhuman can open you up to being superhuman. Normal imagination limits do not apply to you! You can do anything!

Write it as fast as you can. Set a timer, stop thinking, and do not get up or do anything until you’ve finished the current scene or chapter or whatever it is. In two hours, you’ll have something to work with, something tangible to love or hate, and you’ll at least know what you didn’t want to do or where it could be going.

Bounce around. You don’t need to write your story in order. Jump to that scene you’re excited about, and find the pieces to build to it once it’s done.

Steal. Remember that scene you read in that book you loved that was amazing and blew your mind and inspired you to be a writer? Yeah, that one. Twist it up and incorporate it. And don’t feel bad! Read this, watch this, and remember this Picasso quote: “Good artists copy, Great artists steal.”

Take a break already! If you’ve been pouring all your mental energy into the ins and outs of the story so far, taking a short break can be extremely productive. The rest is very good for you, especially after pushing yourself to the brink.

Learn how your subconscious works, and let it do the work. I’ve learned that my subconscious is not productive when I’m playing video games or exercising, but it fires off ideas like crazy when I’m reading fiction or reading advice about writing. In fact, I planned my current NaNoWriMo novel by writing out notes on the story while reading all of these.

Finish. Whatever you do, don’t be discouraged. Chuck Wendig gets it right when he says: “The true author finishes what he begins.” Stick with it and get it done before moving on.

Also, bookmark and read and reread this aloud and often. It works.

6 Web Technologies I Use Everyday

We are overwhelmed with web technologies these days, each promising to make you even more productive than the last. Here are a few that I actually do find useful, and how:

Evernote is a cloud-based collection of documents designed to help you remember. I have lists (to do lists, movies to see, books to read, etc.) that I’m always adding to and pulling from, notes for writing projects, meetings, or conferences, and just about everything else. I use it almost every day to write on the subway (via their iPhone app), but highly recommend downloading the desktop application too. Don’t you just love syncing things?

Trello is an incredible tool (with great UX) for organizing anything. If the static docs on Evernote aren’t flexible enough for your changing needs, Trello is the answer. Think of Trello as a wipe board that you can tape blank cards and labels to. On each card is an item, and by clicking on one, you can add checklists, pictures, or more info to the back. The categorization is intuitive and completely moldable to your needs. I use Trello primarily for my massive to do list, as it helps me separate development and writing work, and maintain priorities without losing the smaller details of projects. Also, multiple people can be assigned to each board, making it perfect for managing a larger group project.

Spotify + Facebook gives you access to tons of music for free online, which is cool enough when I don’t have my full iTunes at work. What I love the most is the ease of sharing songs. Never has sending a song to a friend been easier than a quick drag-and-drop. You can also publish playlists for others, or build collaborative ones. Yes, it is that awesome.

AppsGoneFree is an iPhone and iPad app that shows which apps are free, only for that day. It is a great way to get free apps and games, and I use it primarily for the ease of exposure to the latest trends in the App Store. The apps they feature must have a 3-star rating or higher, and every so often an already popular app is Bumped to free.

The latest update to Mountain Lion incorporated iMessage into its Messages App, and now all my iMessage text messages come straight to my computer in the same place as my Gmail and Aim Chats, where I can respond without having to use my phone. I am SUPER happy about this.

The Pinterest Pin-It Bookmark is my favorite way to hold onto great art/funny memes/any interesting images on the web. If you don’t already use Pinterest, check it out. Click the bookmark while on any website and drop it on one of your boards for showing-off later.

Honorable Mention: DropBox, Chrome’s Bookmarks and Syncing (or any browser, really), Readability (read articles offline with no ads! It’s amazing!), and TweetDeck (for organizing all those Twitter Accounts you follow).

NaNoWriMo Approaches!

If you’ve ever wanted to write a novel, now is the time! NaNoWriMo (short for National Novel Writing Month) starts in just a few days. It’s a fast paced approach to getting a draft of a novel totally done in 30 days. The goal is to write 50,000 words in one month, no editing, just pure creative chaos. If you’re interested, grab paper and a pen and run, hop, skip, or jump (don’t walk) to your nearest thinking chair.

You don’t have to sign up, but you can at the website if you want encouraging emails and notifications about local writery meetups.

I wrote a 50k-worder last year, which I finished a few days into December. It’s a scrappy, rambling piece of junk, but I learned SO MUCH from it and enjoyed the process immensely. I’ve grown very rapidly as a writer because of NaNoWriMo and cannot recommend it highly enough, especially if you think you might like writing, or have an idea for a story you think is worth telling.

And besides, writing is fun! Dive in and swim around and go crazy! You can do anything you want! Want to write a story about how a barrel of evil monkeys dominated and enslaved the real-life cast of Toy Story? Want to write that groundbreaking romantic-comedy about the impossible and forbidden long-distance relationship between a woman in Chicago and Santa Clause? Want to write the most epic vampire, werewolf, wizard war story ever? Do whatever you want! You’ll be glad you did.

Do not fear failure! Chuck Wendig writes excellent advice for writers that you should read (if you don’t mind the language. Children, mind ya eyes.) A quote from him sits at the top of my To-Do List:

“We only get one go-around on the Great Hot Wheels Track that is life, so why not manage some slick jumps and loopty-loops before your car flings off into the oblivion beneath the couch?”
And he’s totally write.

That’s my NaNoWriMo pitch. DO IT.

UNRELATED: I wanted to write a post along the lines of: Things To Never Do In A Blog, but I could only think of one thing, so here it is: Never apologize for the time since your last post, or make excuses about why. Just write whatever you sat down to write. That unnecessary sentence or two ALWAYS annoys me, unless you were abducted by aliens or literally fell off the face of the earth. Actually, in those situations, it still annoys me. Just tell your story.

Hush little baby

Sometimes, when a couple is paying too much attention to their baby, I pretend it was stolen. The fussy little devil is just one in a streak of poorly escalating decisions. Petty theft, the register at gunpoint, then the good old Raising Arizona baby-plus-ransom routine.

But, this time, they are keeping the baby. Because this is real life. You can’t steal someone’s baby and sell it back. No, when you make a mistake, you ignore it for as long as you possibly can, living your life from that moment on as if the lie you’ve created is the honest-to-goodness truth.

Productivity: find something you want to do less

My room was a COMPLETE pigsty (no exaggeration) until this portal to hell opened up right in the middle of it.

At first it was a few inches wide, but it’s growing. Now it’s a few feet across. I have to hop around it in some places.

Anyway, the rest of my room is clean. My desk: spotless. My shelves: organized. My bed: untouched. Which makes sense, as I haven’t been sleeping well, what with all the noise. Desperate begging, screams, wailing, gnashing of teeth, that whole bit.

It’s pretty remarkable. You should come see it. Just watch your step.

These are the facts

Albert Einstein once said: “The best way for aliens to invade the earth would be as chemical-carrying mosquitos.” Once they heard that, they started working.

Now: Here I am, riding the subway to work, swatting away. Who knew anyone on earth could defeat these guys? As such, we don’t worry about it too much.

Why we should worry: These chemical-carrying mosquitos are still chemical-carrying mosquitos.

What we don’t know: What the chemicals do.

What I’ve just learned: The chemicals make us smarter and happier. The aliens are farming our productivity and technology for their own violent and malevolent intergalactic needs.

Blog Tech

With a joyous, optimistic spirit, I registered for two MongoDB courses this morning. The output of the courses is a working knowledge of MongoDB (which is a backend database for web development), and a functional blog, built from the ground-up.

I’m excited to build a blog, but it is TOTALLY reinventing the wheel. There are tons of blog technologies readily available and mostly free. For those not looking for pixel-perfect control and painstaking development experience, here’s a run-down of my favorite options.

In every situation, if you want your own URL, you will need to pay for a domain name (roughly $12/year). In some cases, you need to pay for some storage space too, which can run you maybe $60 to $100-ish. However, if you don’t mind a .wordpress.com or .tumblr.com in your web address, you can do just about everything for free.

WordPress: I love WordPress (I’m using it now). It is a CMS (Content Management System) that will soon take over the internet. It’s fairly simple to learn and lets you do a number of different things, and it has a very active community of developers and designers who are always building more plug-ins and themes. There are a number of free themes available (Google it), but if you’re looking for something more and willing to pay a little bit, check out ThemeForest. WordPress was built for blogs, but allows you to do just about anything, including online shops, corporate websites, and professional portfolios.

Tumblr: Tumblr was designed for ease of blogging. The user experience is wonderful (once you know what the icons mean). It doesn’t have the flexibility of WordPress, and seems to be mostly art/photography based, but it isn’t difficult to make other uses of it, as with my stories or some other fun ones. Tumblr is much more community based than most other blog technologies, as sharing/reblogging is emphasized everywhere. As with WordPress, there are tons of free themes if you look.

Blogger: I use and enjoy Blogger as well. It is easy to learn and use, and provides a handful of customizable options. It has nothing on the flexibility of WordPress or the options of Tumblr, but if you are looking to sign-up and start writing immediately and hate the WordPress Dashboard, this is a great alternative.

SquareSpace: I wish I had a need for this site, because it looks amazing. Check out the demo video! Alas, this site is ideal for a portfolio with big, beautiful photography and paintings. The themes are responsive across devices, and the editor gives you WYSIWYG (What you see is what you get) control over the placement of all content. It looks amazing. However, it’s not free! $7/month for the basic package, $14/month for premium.

There are plenty of other blog technologies out there. If the above don’t suit you, check them out. Dive in!

Discovering the Big Things

Do you ever feel like the things you are writing don’t mean a thing? I’m 500 words into a story, I’ve used all my punchlines, and the two main characters are standing in an elevator wondering who is supposed to speak first. Meanwhile, neither one remembered to press a button. The story is in limbo.

I hate that moment. I want to write something that means something. I want people to read it and say “Yes. YES. Exactly this.” Up until now, I’ve been ok with, “Yeah, I liked it, it was good.” Now I want to move up to the Big Leagues.

What’s it take in the Big Leagues? Here’s what I thought: You have to know what your story is saying. So, baby steps. What do I want to say? Who am I? What do I care about? What do I want people to know or think or realize?

I realized I had no idea.

This was a problem. No opinions? No thoughts? I thought I had thoughts. What the hell have I been writing about?

First I tried to make up some thoughts, and run with them. That didn’t quite work, but it did help my writing.

I read and read and read. I explored classics I hadn’t touched (Orwell’s 1984 and HG Wells’ The Time Machine). I found my tastes pointing towards short stories by Vonnegut, Keret, and Gaiman, which I now LOVE. I also took inspiration from big picture moments like this one from Synecdoche, New York and similar ones in Lost in Translation and Adaptation. This exposure has been super helpful, and I am seeking more and more.

That wasn’t enough. The ideas were great, but none were mine. I was studying the Big Leagues, but not playing with them.

I bought a number of books on writing, as recommended by a few blogs, including this one. Now I have the good old “On Writing/Why I Write” by Hemmingway, Henry Miller, Stephen King, George Orwell, (soon) Ray Bradbury, and a few more about reading like a writer. I haven’t read them yet, but I will be blogging about them soon, here.

Now, NaNoWriMo is coming up. I participated in it last year. I enjoyed it and loved the productivity, but I was unhappy with my rambling piece of junk. Sure, the writing was fine, but the story… I’m not doing that again. No, this year, I have a great premise and I’m going to make something of it.

Here’s the next plan: I’m going on a journey. In the next 10 days, a crash course. I need to discover my writer-self and some meaning. I’m going to sit and free write, stream of consciousness, on a number of what I now call The Big Things. Love, Hate, Life, Death, Pleasure, Pain, Joy, Sorrow, Emotion, etc. Anything Big.

Back on the elevator, I join my characters. I hit the emergency stop button. Sorry guys. We’re not getting off until we figure this out.

Small hands

The circus was coming to town. I, for one, was not excited. 

“Circus” means peanuts, clowns. It means carneys, small hands, and frowns.

It means my co-workers won’t shut up. I thought I hated talking about the circus more than the circus itself.

How completely wrong I was.

My boss volunteered me, so I walked into the ring, visibly reluctant. The crowd got a kick out of that.

As expected, the carneys were aliens. They beamed me to their spaceship. Now I’m 42-billion light-years from earth, a distance I’ve been told by “scientists” was impossible to cover in forty-five minutes.

Third from the door, before the turned seats

Been becoming more and more aware of myself, yet increasingly less conscious. The train is full and slow and fading, and I found a new favorite seat.

These real-life characters are evolving with the weather. Samba stripes take on every color. Heels become boots. Jackets pin more and more to their lapels. Smartphones multiply like gravestones during wartime.

I think, I wonder what if, well, it’s a stupid idea. But: what if all these headphones were playing the same song?

The shakes and squeaks on the train are in tune. Listen to the revs, the thuds. Watch the people dance.

Curtain call

Traumatized, sitting on the train, still holding the stained curtain rod.

Gerald’s life knocked him over the head, images flashed bright between starry lights: a setting sun, a warm, yellow room, two sets of scared but daring eyes.

The curtain, rod-less, was available to cover up, to buy some time.

He suddenly became aware of the curtain rod. His eyes caught it, his hand discovered it. At the next stop, before the doors closed, he tossed it out, and it clanged.

There it still lies, strong, stained, asleep. It knows it has been left, it knows it will be found.

Think-walker

He was a thinker who couldn’t stop. When the thoughts came, he walked out, down the street, and into the next subway station.

He was at a bar one night when the thoughts came. He propped a hand under his chin and started walking. In a station, he got on and sat down.

At night, the stares are longer and the laughs cut deeper. But he doesn’t mind. It’s just people, just noise. He had to reach the end of his thought.

It’s important for one to finish thoughts, uninterrupted, he thought. Where would one be if one could not—

Speak before you think

The artist that changed the world wasn’t known when he was alive.

A girl across the tracks makes eyes at you. You think, “Maybe if she were here….”

What if you’d met the artist? What if you sat next to him on the train two days ago, or right now? If that girl stood next to you, would you even look at her?

Soon you’ll wake up and all the time will be gone. You’ll hear the ding and watch the doors close.

Make choices, not excuses.

Life is a bicycle. Lean forward and keep pedaling or you’ll fall over.

Perfectly frank

Frank kept his life to himself, scrutinizing every word.

He liked to wonder what people thought of him. Less information led to wilder ideas, so Frank always kept a tight lip.

Maybe his boss, holding the door, thought he was a secret poet or artist. Maybe his secretary thought he spent nights hacking the pentagon and holidays hunting black bears.

Maybe his wife thought he worked with the president, and had already told her too much.

In the end, Frank discovered that what most people thought of him was nothing, and what he thought of them was mostly made up. 

A little trim

Couples, like eyebrows, should be more or less the same thickness and shape.

If one of two is a little twisted, it’s quirky. If both are, it’s Jack Nicholson crazy.

They should be surprised or angry at about the same time. If just one of them is, the other needs to pull the first back down to earth.

If they’re too far apart, it’s sad and a little scary. If they’re too close together, it’s just weird and uncomfortable for everyone else.

Most of the time they should be growing, but every once in a while, they need a trim.

Answer, the

So. I found the Answer. The Big Secret. The Reason to Be.

Don’t worry, I’ll tell you. But wait a moment. Ask yourself: Do you really want to know? Why do you feel such a strong pull towards the Answer? Most importantly: What are you going to do if the Answer, well, kind of sucks?

Seriously. Ask yourself.

Ready?

Ok, I’ll tell you: the goal of life is to one day find yourself sitting on the floor, like a child, in the most cost-effective dwelling you can find, surrounded by piles of as much cool stuff as you can afford.

Training complete

It’s not quite a first-name basis, strictly nods and smiles, but with the occasional simulated steam whistle. The crew doesn’t know I’m leaving. Don’t tell.

I’ll miss the train, its crew, its miracles. Especially the miracles.

The time the mailman went postal, pegging packages at passengers like some serial St. Nick. The time we stopped on the beach in Malibu, right after Newark. The crew was surprised and apologetic. Everyone got off and took it easy.

It’s my last time on the train, for a while at least. Don’t tell the crew. Wait. Tell ‘em to keep their eyes open.

Loosing our minds

The kids said Dad was loosing his mind. ”You mean losing.” Mom said. The kids frowned. She wouldn’t understand. Maybe she’s loosing her mind, too. 

The tethers loosened more and more, and the minds floated higher and higher, like kites, or hot air balloons. 

The kids tried to tighten the knots, but they were too short or their fingers were too weak. 

A storm was rolling in. The balloons swayed in the wind. The littlest kid started to cry. 

“Maybe looser minds aren’t so bad,” said the oldest one. 

Great, thought the kids. Now we are loosing our minds, too. 

Don't force it

This hipster girl is wearing C-3PO shoes. Not look-alikes, the real thing. Bulky, but she can pull it, uh, him, off. 

The whole thing annoys me. He’s a chatterbox, C-3PO. Lots to say, nothing to say.

He has long conversations with the tourists, from the subway floor. Always brings the conversation back to himself. 

This hipster girl is ignoring him now, and he’s getting kind of mad. I wonder what he does in her closet, when she’s not wearing him. 

I say, “Your shoes.”

She says, “Junk yard sale.”

I say, “Well,” pause for impact, “they make you look fat.”

Mourning my morning

Missing the train by seconds gives me time to curse, swear, and stomp my feet, then thoroughly critique my morning. Forgetting 20 minutes of alarms, I place the blame on three moments:

The neighbors’ phone drove me on a frantic search for my own, only to find it in my hand.

I gave my facial hair 3-minute pep talks both before and after my shower. I fear the hairs will only further rebel.

I was feeling too-cool-for-school to run for the train, even though everyone else did. They made it.

People need conclusions and scapegoats. I’m glad I found mine.

Beforewards

“The End,” she’s reading, but then turns the page backwards.

The train stops and I moonwalk onto the platform, then smile, walking backwards up the stairs. I’ve been here before, I know where I’m going.

Doors open themselves behind me – I step back and close them.

Soon, I’m in my apartment. The next part isn’t so nice. The oatmeal felt better going in.

Then I’m wet, so I shower to dry off. 

I turn on loud, blaring alarms around my room, get into bed, pull up the covers, and close my eyes. 

When the story is finally silent, it begins.

New, clear warfare

Dream: He was a pilot and a bomber, dropping the most powerful weapon the world had ever seen: love-bombs.

Over the enemy’s capital, he unleashes a barrage of winks, crushes, temptations, and first kisses, packed into twenty or so iron eggs. They fall slowly, almost drifting, but explode on impact, hatching sunsets, candle-light dinners, heart-shaped mushroom clouds, and emotional bliss.

Back at the base, the commander-in-chief: “Take a break, gents. We invade in 10 months.”

But then, an infant’s scream. The bomber rolls over. His wife: “Your turn, dear.”

He gets out of bed, realizing he’s already lost the war.

These are one or two liners

Blind date: Christian. Is he Christian? Or is that his name? Never met a boy named Jewish.

Needs. Girls: Air conditioning and Hair conditioning. Medieval Princes: Heir conditioning.

That local elderly marching band is exactly as funny to watch as you think it is.

A germ-detecting super hero’s sidekick is a cat in a Cat-in-the-Hat hat. They always catch a cold and their culprit, who is that fat bat that sat and spat on my friend pat.

In a world where Prince Charming doubles as the Tooth Fairy. Me: “Dweamth dooo come twoo!” Prince Fairy: “Not quite. Here’s a nickel.”

Unspoken rules of the C train

You can at anytime claim seniority and get a seat, if you have been on the train longer than someone who is sitting.

Leaning on the doors is totally fine.

If there are multiple seats available, always sit in the one with the greatest number of surrounding empty seats, unless one is between two pretty girls.

If the train is squeezed so full that you are touching the people around you, you must avoid eye contact at all costs.

You can sing along with your music as long as its not Justin Beiber.

All service changes, even planned ones, suck.

Full, 4-minute relationship

Crush: I stand next to her on the platform because she’s cute, and because she smiled at me.

Honeymoon: I am happy to have found such a person, and catch her stealing glances while checking for the train.

Love: My misty eyes know there is nothing like what we have. We could make this work.

Heartbreak: The arriving train is hers and not mine. I say nothing. She boards, turns, and stares. We don’t break eye contact for as long as we can, until the train is one stop ahead.

Sometimes you don’t work up the nerve until it’s over.

What I'll tell my kids

I was leaving for work when I remembered to brush my teeth at the last minute, and it was a good thing. Two steps out the door, the teeth-brushing police were in full force, grabbing random jaws for inspection.

Fresh and minty breathers got a slap on the cheek and a box of floss, those who ate after they brushed were ruffed-up a bit and fined a few crowns, and the morning breathers… well, I’m glad I remembered.

There have been stories. Bad ones. Usually ending with nasty pulls and giant drills.

Which reminds me. I need to shave tonight. 

Olympic dreams

It was late and the car was empty, save for the cutest, prettiest girl that floated next to me.

“You have to hear about my dream.”

She was eating cheerios, but the taste! Blueberry, then strawberry, then butterscotch!

She checked the box. Butterscotch-tasting cheerios means you win the Grand Prize, a trip to the Summer Olympics in London! Be sure to call within 15 hours! She called, and they answered, and everything was going great until the train beeped and she woke up.

“Isn’t that terrible?”

I turned, to empathize with her dream-loss, but saw that she was never there.

Canal St.

On the facing platform, a performance is taking place. It is Canal St.

Originally written by Homer, then reimagined by Bill Shakespeare, the play features a bucket-drumming beggar, his friend without a home, and the unlikely tale of their friendship at the hands of several young, apparently deaf, scornful women.

Critics rave! 4-star reviews!

“Best kept secret on Broadway.”

“Canal St. is honest and pure, the perfect execution of a forgotten classic.”

“Well, it was ok.”

“Who ever played [the homeless guy] really stares truth in the face. I was so blown away that I almost missed my train. Almost.”

Secret admirer

In a post-it note, she wrote that I smelled like sunshines and flowers. Weird, but here’s some logic: those two things defy gravity in the same way that I resisted the pull of her rotund figure.

She smelled like Cheetos. I love Cheetos, but not love-love, you know?

I threw the note out, but the next day there was another. “Sunshines and flowers.” A fortnight and fourteen notes later, I had to fire her. She left.

The notes never stopped coming. I’m not sure where they come from, but I keep in them in my desk drawer. It’s almost full.

Pipedream

Arnold found he was in love with the office bathroom, in particular the bathroom’s sink. It whispered sweet things to him and told pointed jokes, things about his coworkers no one had ever seen.

Arnold kept it very quiet. He was the guy who made fun of the Long-Sitters, as he called them. Now he couldn’t stay away.

Then one day it wouldn’t talk anymore. He never knew why.

Soon it was replaced, and the old sink was thrown out. 

Arnold misses the speaking sink. He thinks about it when he hears a flush, or the drip-drip of the rain.

From drab to fab

Why is the subway’s dominant clothing color a dull dark grey black blue?

I’m not saying it’s a problem, it’s fine, wear what you want. I just wonder why we don’t break out more.

Don’t say it’s because the people are underground, because most of them end up above the ground for most of the day. Or so I’ve heard. 

We should bring the sun down there and light that bad boy up. I’d wear Crayola 64-color Crispy Mac and Cheese pants to that commuter party. With a Pink Flamingo Strawberry Popsicle-flavored t-shirt.

And I wouldn’t be the only one.

Guac-butt, my friend on the train

It’s funny when someone you run into remembers you, and you don’t. You nod and squint and ask if they are sure just short of too many times. Ha ha ha, right?

But it’s funnier when they are lying and just feel like talking or making a new friend on the train.

“You don’t know me from that thing? At Dave’s?” They speak very loudly. “Yeah, I know that was you. You sat in the guacamole and the dog wouldn’t stop sniffing your butt! HAHAHA! You don’t remember? Oh it was too funny.”

Now the whole train thinks you’re Guac-butt.

Just beyond the glass

An investor commissioned a secret project for a visionary young artist named Chambers. Chambers was given everything he demanded, construction and demolition crews, interior decorators, everything, right down to the last fork and knife.

They thought it would make the news on the first day, but it wasn’t until two months had gone by that a child on the C train asked his father if the subway could run through their apartment too. The boy was the investor’s son.

“No,” the investor replied. “The train only runs through Chambers’.”

No one else has noticed yet, but, believe me, it’s there. 

Red ribbon

I see you there, the red ribbon in your hair. What is this, the girl scouts? A secret club? Or are you really that interestingly dressed for work?

Does it distract you at your desk, while you twirl it? Do your coworkers look when they walk by? Did you wear it while you talked to your boss about that promotion today?

Were you looking for a date? Or compliments from your favorite bum?

I’ve got some good ones I’ve been saving for you. But you know what? You get no hoots this time. This bum thinks you’re trying too hard. 

Headed north

A waddling waddler waddled past me onto the train this morning. She sat down with a group of penguins twittering madly on their phones. They were headed north.

It’s funny how penguins sit. They have almost no legs, so really they can only stand, but they had the bench on the car, so I called it sitting.

I wanted to ask where they were from, where they were going, how they had gotten here, why they were visiting New York. But I figured they got that all the time. I didn’t want to bother them, so I went to work.

Just a little

What do you think, where are you from, where are you going? I want to know what movies you watch or what books you read, but more than that, what part you’re on, how you feel about it, how it makes you feel. We are all a million miles deep, or close to it, and we all have this shared experience everyday. Why can’t we talk about it, figure it out, show some support, not as anything more than some people riding in the same car? 

Come on, guys. We’re not just commuting, are we? Let’s hang out a little.

Earmuffs

She had that wide-legged power-stance, Subway balance without handlebars. Impressive. 

She pushed her hair behind her ears, and I saw black nail polish. A sign of either attitude or sexiness. I poked her in the back to ask, but was ignored. Must be sexiness. Sexy girls never like the cool guys.

I’m one of the cool guys. I wear plaid flannel and big headphones. I like thick scarves and deep scars.

When you see me on the train, or feel me poke you in the back, you should know, I’m not listening to anything. I just like wearing the headphones. 

Pillage and plunder

There was a Viking going door-to-door, looking for his skateboard. He needed to get to school on time, but he couldn’t remember where he’d left it.

The Viking couldn’t be late for school today. He was already in trouble with Miss Crabtree for pillaging the sea of desks. And besides, he had a math test that morning.

At the third door, a small girl told him she’d seen it down the street near the sewer. She showed him where, and the Viking fished it out with his horned helmet.

“Good luck on the test.”

“Thanks little girl,” said the Viking. 

First in cast

It was somewhere between the broken ankle, the painkillers, the cast, and the spaceship, that our intrepid hero found herself on the moon. And there were dinosaurs. Wearing moonboots.

The show was this Tuesday, and all the dinosaurs were abuzz. Everyone expected T-Rex to win with his rainbow-striped boots, but some of the pterodactyls and triceratops were putting up a fight, with the clever use of pink and orange solids.

In the end, our intrepid hero stole the show. Her boot and crutches were like nothing they’d ever seen. She stole the crown and crowd surfed on dinosaurs all night.

A problem that I have

I always find it at Chambers. Where I lose it, I don’t know.

I usually notice it’s gone at the bar. I approach someone or I bump into the prettiest girl coming out of the bathroom. I figure my knobby hands or my rake of hair sends her off. Then I realize that it’s missing.

At Chambers, my mojo cowers under a bench. I shoo the people away and say sweet things to it to coax it out. Then I nab it, strangle it, and swallow it right there. Don’t even wash my hands. 

It always finds a way out.

Fun things to pretend on the subway

Pretend everyone is trying to decide whether they like pink or blue cotton candy more.

Pretend everyone is dancing in rhythm like at a party.

Pretend everyone is trying to use ESP, and then figure out what they are saying.

Pretend everyone else is trying really hard to not fart.

Pretend everyone else knows magic, but they aren’t allowed to tell you or they’ll go to wizard jail.

Pretend everyone missed their stop three stops ago but no one wants to admit it.

Pretend everyone secretly watches Martha Stewart online at work, and can’t wait to see the next episode.

The ugly bros

We had a band called The Ugly Bros. It started as a joke. The five of us were conductors for the subway, and we’d play in different stations on our breaks. People liked us pretty well, I guess.

Pretty soon there were too many people to have the concerts underground, so we started setting up in parks around the city.

Our biggest fans were homeless people and small children. Neither grouped seemed to mind the other, except for the kids’ parents.

We were the voice of the people. We played anything and everything. We mostly played with chopsticks on trashcans.

The Deleter

He was The Deleter. He deleted anything and everything, without a second thought.

Soon, he was in the Oval Office. “I hear you… delete… things.” The Deleter nodded and deleted the memory, eyeing the computer.

He was a small man. They shoved him into a box and shipped him off.

The enemy, in his own Oval Office, opened the package labeled, “Surprise gift from Aunt Marge!” The Deleter unfolded and presented himself as an IT Technician.

Soon, all of the data was gone. “Oh, it’s no problem,” said the enemy, revealing a drawer filled with hard drives.

“I’m The Backer-Upper.”

Generix is perfectly safe

I’m at work. My lungs are burning, my muscles are weak, and my headache is blaring.

Some big name pharmaceutical companies, desperate to fill their clinical trials, have turned to testing the copywriters at their ad agencies.

You’d think they would grab the interns first. Sadly, it’s still spring.

Oh, here comes the doctor.  

“I think I’m dying,” I tell him.

“Nonsense. Generix is perfectly safe. Besides, you were in the control group.” He smiled. “Your pill was only sugar.”

I coughed and gagged, “I’m allergic to sugar!”

As I died, he said: “Well, this will certainly skew the results.”

A periodic purchase

The day I saved the world I was at Walmart looking at shower curtains. I went because my wife wouldn’t stop nagging.

They had all kinds. Too many, if you ask me. I bought one called: “Periodic Table of the Elements.” Thought it would piss her off the most.

Weeks later, my son ran into my room, toilet paper stuck to his shoe, asking about Hydrogen and Helium. Years later, he graduated from MIT. He won a Nobel Prize for Biology. His letter said he had solved cancer with “Recombinant double-stranded RNA.”

I’m just glad the thing was on sale. 

Anyone else have dreams like this?

I used to know them.

They had dated on and off, and now they came to me in a dream, where you can never quite think properly.

There were tears in their eyes.

“We’re running away” they said, as if they were going to elope.

“Oh. Wow,” I said. 

“We ran away,” they said, as if from a car crash.

“Oh wow,” I said.

“They ran away,“ they said, as if they were hit in the car crash.

“Oh, wow,” I said. 

“Put that gun away,” they said, pointing to the gun.

“Oh.” I looked down at my hands. “Wow.”

I smell a rat

I walked onto the platform to find five ghouls eating McDonald’s and tossing the trash across the tracks. They all stared across the gap, not noticing as I stepped between them. 

On the facing platform two rats fought over the unwanted half of a cheeseburger. The ghouls were captivated by the fight, unable to look away. Finally the smaller rat fell off the track, and the larger devoured the burger.

I always pull for the underdog, so I felt bad. Since this is my story, I’ll leave you with the larger rat’s unwitting demise at the hands of his cholesterol.

Lucky gets the girl

I never thought I’d get a girl. Either I’m stupid or I just don’t think.

Then one day, it happened on the subway. She had a mouth, telling people to look her way and roll their eyes one more goddamn time and see what happens.

She said something to me, but I wasn’t listening, I just kept on singing the song in my headphones.

And that was it. She followed me off the train and made me buy her a sandwich and a soda.

You could say I’m a pretty lucky guy, but you don’t need to. I already know.

PSA about the mirror, mirror

Somewhere in between Brooklyn and Manhattan, a window on the C Train flickered into a mirror that reflected the viewer’s beauty. Everyone on the car stared, and then started slowly posing in front it, watching the beautiful reflection of their bodies and faces, looking fabulous.

The car slowly filled up, and no one got off. No one could look away from the mirror, and soon no one could move at all, because the car was so packed.

Those people are still there. If you ride the C, be careful of that train, and that car. We couldn’t pry them away.

Special deliverance

Later, as if he’d planned it, He fell from the sky into the lake, just three feet from the front of my canoe. I had been fly fishing for two hours, praying to the Dear Lord from some sort of deliverance, just like my poppa taught me. Now, here He was, soaking wet, covered in algae, almost capsizing the boat as He clambered in, beard and robe quite askew.

“Deliverance?” He said, the way my pizza guy says ”Delivery?“ 

“I was hoping for some fish.”

“Oh. Cast your net over the other side.” Then he walked right off the lake.

Career

They put me in a corner, by the freight elevator, and told me to answer the phone. Soon it rang, so I picked up.

It didn’t go well. There was a voice on the other end, but I couldn’t hear it over the elevator.

Soon I had a steady paycheck, so I kept going, listening to the little voices, never quite hearing them.

Then one day I missed the call. It rang twice, then stopped.

They didn’t fire me. I quit.

Now I’m making calls to a freight company. No matter how loud I yell, they can never hear me.

Aches and ashes

I had this friend who totally fell apart. Aches started in his joints, and his face was burning up.

Later he was losing things. He dropped his fork and never found it. He thought it was gremlins, or the cat. 

Chunks started to fall off. Hair, skin from his chest, his left foot.

Yesterday he missed work, so I went to see him. Ashes covered his bed and a newborn lay there, cooing. Cutest thing I ever saw.

I don’t know much about raising a kid. I bought a kennel and a food bowl, so I think I’ll be alright.

Is funny the right word?

It’s funny how people grow apart.

I met her at a bar, like any other chick. She was drinking Magic Hat. Fine by me.

Months later, it’s funny how we’re still together. We laugh. It really came out of nowhere.

I’m not a “the one” guy, but can you meet “the one” at a bar? Does that happen?

What if I had never gone, or been in the bathroom, or if someone else met her first?

Anyway, we haven’t spoken in a few years. I guess by now I could say it’s funny. I’m not sure what else to say.

Time in the dark

Darkness only comes out at night, and, sadly, less and less these days. It barely has time to breathe anymore.

When the lights go out and the screens flick off, there is so much to see. Let your imagination open its eyes. Let the stories come to life.

Beings wait, just out of sight, behind the nearest tree, under your bed.

Emotions that run from the light grip your mind and shake you awake.

Let it envelope you, or comfort you. Let your dreams skip about, or let them run amok. A nightmare is only a dark horse. Ride it.

The money

He was the son of a very rich old man, and he thought of nothing besides the money.

Each day he’d waste away, in the backyard pool, lazing on the lawn, sometimes never getting out of bed, always thinking, thinking, thinking about the money.

And why not? He had nothing else to worry about. He’d be well off forever.

His father died, and gave the money to an unnamed charity, where it was whittled away. 

Now, he lies in the street, or on a subway car, or in an ATM booth, and thinks of nothing, nothing, nothing.

Except the money.

Get nice and clean

It was a strange reality that You woke up in one morning. Everything was essentially the same. Gravity still pulled toward the center of the earth, the sun still rose in the east and set in the west, and people still spent inordinate amounts of time in traffic or subway cars.

The thing was, there were no showers. Everyone took baths. Not in water. They bathed in gin.

It wasn’t so bad, really. Alcohol kills germs, and eventually the smell was refreshing. You could even pay more for the real high-end stuff.

Just be sure to keep your eyes closed. 

Not a true story

The night started with a gin bucket. Well, it started with a “Let’s go to that Turkish Techno party.” Then later, it really started when we found the gin bucket. The night ended unhappily in a bathtub, and in between I remember shoveling cake with my paws, chugging abandoned drinks off windowsills, streaking, fuzzily conversing with a gentleman of the law, and throwing people out of my room so I could watch Planet Earth. Then, of course, the wobbly walk to the bathroom and the tumbly tumble into the bathtub.

I woke up, primarily confused by the Mardi Gras beads. 

Smooth criminals

The Warden of the 18th State Penitentiary announced a dance competition. He wanted to scout backup dancers for his daughter’s performance in the school talent show.

Every prisoner auditioned, but three stood out: Big Bob, Lanky Larry, and Tiny Tim with his crutch. Each put his heart and soul into the final song, which was Thriller, and even some of the hardened prisoners had to dry their eyes after witnessing such beauty. The Warden had no choice but to name all three as winners.

In the end, it didn’t matter. The Warden’s daughter changed her mind, and did gymnastics instead.

The issues

She was sipping gin in the bathtub, fully clothed, lying on top of the magazines. Some would call her a hoarder, but really the tub was only half-full. The issues conformed to her shape so closely that they could have been arranged that way. And besides, she wanted to read all of them. Eventually.

She thought about her next story. Would it begin here, in the bathtub, on the magazines? Would the gin help? Perhaps more gin would. She poured a fresh glass.

Her husband appeared in the doorway. “Working again, I see.”

“Harder than ever.” She took another sip. 

Definition by example

Comedy: A couple fell in love and was married. They settled in together. She made him tuna for lunch each day.

Tragedy: He loved his work. She began to resent him. He didn’t like tuna, but never told her.

Conflict: She began to see someone, someone that made her feel young. He swapped the tuna with a friend at work everyday.

Irony: Her lover was her husband’s friend from work, but none of them knew.

Plot: She poisoned the tuna. News of her lover’s death came with handcuffs. Husband and wife were locked up, and eventually learned to love again.

The hipster movie

Things overheard from hipsters outside a hipster movie:

“Yeah, I guess I would say it was… good.”

“I really liked the idea of the movie. I didn’t like the movie itself, but, the idea of the movie, that I liked.”

“When are all these hipsters going to stop wearing all these hipster clothes? Oh thanks, these are custom-made converse. My Dad works at Nike.”

“It was basically a knock-off the Great Gatsby combined with a knock-off of that knock-off of the Great Gatsby we saw last week.”

“I really would have enjoyed that, if it wasn’t for all the hipsters.”

Questionnaire

Before moving in, she asked him one question.

“Any vices I should know about?”

“I don’t want to tell you, it’ll just get on your nerves.”

“Then you have nowhere to go but up.”

“I smell.”

“See, that’s not so bad.”

But, he smelled like delicious cinnamon rolls. Each morning, down the hall, she woke up salivating. It only grew worse, until one morning she was at the foot of his bed, knife and fork in hand, crazed expression on her face.

He had to move again. In an email, his new roommate asked, “Any vices I should know about?”

Theft on ice

Joan was on her third consecutive double-shift when Frosty slid in, top hat and all.

“Empty the register,” he ordered, thrusting a bag across the counter.

Joan didn’t move. “Come on, Frosty, not again.”

Frosty stuck an arm into his white chest and pulled out a revolver. “EMPTY. THE. REGISTER.”

Joan, staring into his button eyes, opened the drawer. As she pulled out the bills, she discreetly felt under the counter for the thermostat.

“Why do you do this?”

Frosty only stared his cold stare.

Ten minutes later, she walked around the counter and lifted the bag from the puddle.

Jack

Jack was taller than his mother before his seventh birthday. Ten years later he stood at twenty feet, with tree-trunks for legs and a three-barrel chest. His mother was poor, and Jack had little more than his size.

When he found the beanstalk, he knew he would climb it.

Up in the clouds, there was a small house filled with bags of gold. He heard a squeak below him and saw a tiny man yelling in a high-pitched voice: “Fe, fi, fo–” Jack brushed him aside, grabbed a bag, and left.

He and his mother lived happily ever after. 

Adventure capitalist

Joe owned no phone, but wandered the C-train talking on a Bluetooth earpiece. The subway regulars knew all his girls: his dramatic ex-girlfriend, his half-sister in Idaho, his niece who loved Barbie.

Joe only talked to one man: Benny, an investor with diverse assets that touched every angle of the consumer market: medical devices, sporting equipment, advertising, television, retail. Benny’s wealth was economy-proof. He continued to grow, reading the market and making bold, successful moves. Nothing could stop him.

Nothing except for Joe, who dropped the earpiece between the train and platform at the 23rd street station. Mind the gap.

Traumatic points

Jerry was a salesman one point from a sale. “The point is…” Jerry was saying. The intern to his left, whom Jerry would soon learn “seemed troubled,” ran to the window and leapt into free fall. 

Jerry lost his job weeks later. His sell line, “The point is…” brought to mind the boy’s final moments, leaving Jerry speechless.

After that, Jerry’s girlfriend left him. He was unable to answer the question: “Jerry, what is the point?”

Now Jerry works as a janitor in a one-story elementary school in Lexington, Kentucky. He avoids sharpened pencils and sporting events that keep score. 

Who's your favorite uncle?

Reports of Uncle Sam robbing convenience stores bounced around until they cornered him in a tree house behind a dumpy trailer. The policeman smirked over the speaker, “I WANT YOU to come down from there.”

A purple minivan pulled up and a young mother stepped out. She took in the scene, inhaled, and yelled, “YOU BETTER GET YOUR BUTT INSIDE BEFORE I GET UP THERE.”

The thief sprang from his tree. Halfway across the lawn, the wig fell to the ground.

The boy returned the money. His mother was upset, but laughed. “I WANT YOU to go to your room.”

Mushy pizza story

It isn’t easy to sell pizza, especially to people who don’t order it. But my “Surprise! Door-to-Door Pizza Delivery!” enterprise certainly does save on gas. Especially in apartment buildings.

It was in one such building that I met my Jane. It was Valentine’s Day, and although she hadn’t ordered a pizza, she had placed a spiritual order for a “real” man. I opened the door and she swept me inside, praising the Good Lord for His Delivery.

Years later, things haven’t changed much. Every Valentine’s, Jane and I watch Finding Nemo and pig out on candy. And we love it.

Space lab

Dr. William “Spot” Johnson was to be the first labrador to pilot a spaceship to the moon. After finishing first in his major, Aeronautical Engineering, Spot had trained directly with NASA for years. He had anticipated this day since he was a pup.

In his specially designed cockpit, he began to flip switches and feel out the controls. The ship’s hull was loaded with essentials for a moon landing: delicious space-bones for food, equipment for scientific research, toys for alien space dogs.

Just then, Houston came over the intercom: “He looks so cute when he’s sleeping. Look at his tail!”

Alexander, the not great

Alexander did not think about death. He could not comprehend the concept of time, and paid no mind to the sheer size of the universe. He only knew that he had an important presentation the next morning, and preferred a good night’s sleep.

So, when several Timeless Beings visited him that night, the gravity of the meeting escaped him.

He blinked slowly while they laid a plan for Alexander, giving deep, profound meaning to his existence. He nodded as he lay back down.

Speechless, the Timeless stared. Alexander rolled over and mumbled, “Just be sure it’s all finished by morning.”

First person vs third person

I carry baggage.

Henry Thompson doesn’t.

I launch the story into blissful abyss, or drag it down emotionally.

Henry Thompson has a very nice pleasant time, or a rather uncomfortable evening.

I don’t mind telling you personal secrets about myself. In fact, they’re really not secrets at all, because you’re inside my head. I’m really just thinking.

Henry Thompson is embarrassed to share certain things, like the time he was caught in the Girls’ bathroom by accident in 5th grade. He doesn’t mind too much though, because he understands the need to open up, for the sake of the story.

The king's tax

He was King Carl of Camelot, or, as his people called it, the C Train. In robes and a crown, he’d walk between the cars, announcing his arrival with a fanfare of electronic trumpets.

“Here ye, here ye, the King has arrived for the daily tax collection!” And he’d walk along with his golden basket, taking what was rightfully his.

One day, a particularly unruly peasant wearing blue would not turn over his silver badge.

“Humble yourself before the King!”

“Sir, have you been drinking?”

“The King’s Wine is his own!”   And His Majesty was locked up in the dungeons.

Prompt from a friend: basketball

Everyday after school there was a shootout. Noah’s Arcs vs. Three’s Company. The chain nets rattled like spurs.

Each one got dirtier. Lowered the moral bar. No one remembers who threw the first rock. By now you’d get home with nicks and bruises.

Someone brought a cap gun. They got used to the BANG.

Then, there was the Secret Weapon, from some father’s hidden drawer. He held it in his pocket, pointed it at you while you shot.

The last shooter was used to the sound, but not the recoil.

The last shooter expected the BANG, but not the pain.

Ode to the woman in the Portlandia intro

Oh, brown-eyed woman in the Portlandia intro

even though your show is not super well-known

and you probably aren’t even an actress

I love you.

Your smirk.

Your bleach white hair

Gelled sleekly to the side.

You look smug, yet happy.

I don’t know if it’s you or the stark contrast to the man with the huge afro shown before you,

or the old man smoking the cigarette just after you.

I am made to assume that you are the typical Portlander

and soon I will be too.

Maybe it’s the music

This show’s brief moment of quality

contrasted with the summarily drab content.

That drum beat over your image

is synchronized with the beat of my heart.

Maybe it’s the panning shots of Portland,

the hazy green filter that makes everything green.

My favorite color, as you will soon know,

when I find you.

The cutest angry couple

He was a man of illogical emotions.

            She could not stand extreme temperatures.

He hated bubbles, especially those that sprung from shampoo.

            She hated that turning down the cold sometimes made it colder.

He loathed the shower curtain, rising to meet you, like a ghost.

            She loathed physical contact with water above or below 102.6 degrees Fahrenheit.

Still, they showered together, scowling in their anger.

Because you had to shower, you know, or you would stink.

She popped the pesky bubbles. He blocked the boiling or freezing water.

And they were happy to fight the shower, and not each other. 

The juice box guy

On the news they said he was poisoning juice boxes, one at a time, with a syringe, at a gas station. I brought a girl home but she said my bathroom smelled like piss and my room like farts. So I went after him.

Fourth gas station, I realized this was a bad plan. Fifth, I found him.

In a Shell, lab coat and everything, syringe in one hand, juice box in the other.

“So you’re the juice box guy.”

He stuck himself and injected, left forearm.

Waiting to die, he stabbed with the bendy straw and sipped. Fruit punch.