Command-line json parsing

This morning I needed to do a batch of API calls and parse the result for a report. It was a perfect storm for me to try out the jq command-line json parsing too. Here’s one example from my shell script: First install jq.
$ brew install jq
And here is a sample response from our metrics API. This is what jq is going to parse.
GET http://indatus.com/api/companies/357/metrics

{
  total: 40,
  totalCalls: 279,
  emergency: {
    response: 351
    total: 24
  },
  general: {
    total: 7
  },
  leasing: {
    total: 9
  },
  courtesy: {
    total: 0
  }
}
curl the API and pipe the response into jq. Notice how you can pipe emergency.response (seconds) through a filter that converts the string to a number and divides by 60 to print the response time in minutes.
$ curl -s 'http://indatus.com/api/companies/357/metrics' | jq '. | {total: .totalCalls, emergency: .emergency.total, general: .general.total, leasing: .leasing.total, response: .emergency.response | tonumber/60}'

{
  "leasing": 9,
  "general": 7,
  "emergency": 24,
  "total": 346,
  "response": 12.8
}

Git Tips: Amend previous commit and keep commit message

$ git commit --amend --no-edit

Nuggets: Laracon NYC 2014

Talks

Learning

Domain Driven Design

Tools

  • Laravel Forge - Instant PHP Platforms On Linode, DigitalOcean, AWS, & Rackspace.
  • Laravel Cashier - Laravel + Stripe = Painless subscription billing.
  • Laravel Homestead - Laravel Homestead is an official, pre-packaged Vagrant “box” that provides you a wonderful development.
  • Laravel Settler - The scripts that build the Laravel Homestead environment.
  • Deckset - Great-looking slides from simple Markdown files
  • gulp.js - The streaming build system
  • browserify - Browsers don’t have the require method defined, but Node.js does. With Browserify you can write code that uses require in the same way that you would use it in Node.
  • watchify - Update any source file and your browserify bundle will be recompiled on the spot.
  • moment.js - Parse, validate, manipulate, and display dates in javascript.
  • GIF sockets - Real Time communication library using Animated Gifs as a transport/
  • Khan Academy structuredjs - A js library for verifying the structure of Javascript code. It is useful in checking beginner code to provide feedback.
  • vaprobash - Chris Fidao’s Vagrant provisioning bash scripts.
  • serversforhackers Newsletter - Chris Fidao’s devops 101 newsletter.
  • papertrail - Cloud hosted log management.
  • Ace - An embeddable code editor written in JavaScript.

People

First day in the new downtown #Louisville @indatus office!

Git Tips: Branches not Merged

git branch --no-merged

Code PaLOUsa 2014 - Your Lazyweb Itinerary

You can keep flipping channels in your cozy hotel room, I’ve done the work of planning tomorrow’s itinerary for you. Here are the talks to sit in on this week at Code PaLOUsa in Louisville, KY.

Tuesday

10:00

  • Ember.js, Jesse Cravens, Jones
  • Agile, Martin Harbolt, Segell

11:30

  • NoSQL vs SQL, Simon Elliston Ball, French
  • When Code Reacts to Data, Jessica Kerr, Jones

2:00

  • Environmental I/O with Android IOIO, Scott Sullivan, Doing interesting experiments with Arduino
  • Managing Developers, Jonathan Mills,

3:30

  • Web apps that look native, Rob Tarr, French
  • Designing in the browser with Sass, Chris Michel, Combs Chandler

5:00

  • Getting Started with Glass, Jacob Rutledge, Segell
  • JMeter load testing, Michael Dowden, Stopher

Wednesday

9:40

  • Job queues, Ole Michaelis, Stopher
  • Superman is not a good Agile Team Member, Karen Siers, French
  • Domain-driven design, Reza Rahman, Segell

11:00

  • Finding and using big data - Hadoop, Simon Elliston Ball, Combs Chandler
  • Meteor.js - Killing Dinosaurs with JavaScript, Guy Royse, Nunn

1:30

  • Avoiding UI Mistakes, Danielle Cooley, Grand Ballroom A

2:50

  • Virtualize your stack with Vagrant and Puppet, Jacob Mather, Jones

4:10

  • Using Node and Grunt to create an awesome workflow, Vernon Kesner, French
  • SOLID design patterns, Philip Japiske, Segell

Roller Skating Jams

Back in November, we had a neighborhood roller skating party. Here’s the playlist I put together:

  • Blackbyrds - Happy Music
  • Newcleus- Jam On It
  • Frankie Smith - Double Dutch Bus
  • Teena Marie - Square Biz
  • Fatback Band - Gotta Get My Hands On Some (Money)
  • Still in the Groove – Ray Parker, Jr.
  • Jackson 5 - ABC
  • Planet Rock - Afrika Bambaataa and the Soul Sonic Force (INSTRUMENTAL)
  • Kraftwerk - Trans Europe Express
  • Herbie Hancock - Rockit
  • Eric B and Rakim – Don’t Sweat the Technique
  • Michael Jackson - Wanna Be Startin Somethin
  • M.C.B. - Oh Inspector (It’s The New Mix)
  • Tom Tom Club- Genius Of Love (INSTRUMENTAL)
  • Yes - Owner of a Lonely Heart
  • Eddie Murphy - My Girl (Wants to Party All the Time)
  • New Edition - Mr. Telephone Man
  • The Unknown DJ - Basstronic (INSTRUMENTAL)
  • Dance to the Music – Sly and the Family Stone
  • Vaughan Mason and Crew - Bounce, Rock, Skate, Roll
  • Midnight Star - No Parking On The Dance Floor
  • Parliament - Flashlight
  • Tony Chambers - Football Hero (INSTRUMENTAL)
  • Queen - Another one bites the dust
  • D Train - You’re the One for Me (INSTRUMENTAL)
  • The Big Bang Theory – Parliament
  • Peanut Butter – Twennynine and Lenny White

Git Tips: Argh! I forgot to add something to that last commit

$ git add app/file/that-i-forgot.js
$ git commit --amend

Agile Software Manifesto Principle #10

Simplicity—the art of maximizing the amount of work not done—is essential

New #ink #drawing