Skip to content

Instantly share code, notes, and snippets.


Michael Pearson mipearson

View GitHub Profile
colingourlay / idle-analytics.js
Created Sep 7, 2016
Defer the standard Google Analytics script until the page is idle, in supported browsers.
View idle-analytics.js
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
ga('create', 'UA-XXXXX-X', 'auto');
ga('send', 'pageview');
joho /
Created Apr 20, 2016
Follow on resources from a work talk I gave related to developing staff.
View Makefile
# Hello, and welcome to makefile basics.
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
# Once you're done here, go to
# to learn SOOOO much more.
jwalton /
Last active Sep 18, 2020
Rickshaw Graph is a drop in replacement for Dashing's graph

Graphing Widget

The graphing widget shows graphs using the Rickshaw graphing library. The names of data fields should be (vaguely) familiar if you've used Rickshaw before.

It's recommended that you replace the /assets/javascripts/rickshaw.min.js from your dashboard with the latest from here.

Supported HTML data fields

dnagir /
Created Nov 23, 2012
Unobtrusive and testable AJAX in Rails 3

The problem

Initially asked at RORO but I will elaborate with an example.

What we need to do is the following:

  • we list a set of items (let's say posts) and want to show a drop-down menu next to each one (quick example)
  • when the drop-down arrow is clicked the menu is loaded from the server.
View Rakefile
require 'rake_timer'
pda / spec_helper.rb
Created Mar 14, 2012
Fast RSpec with a tiered environment: SPEC=(unit|model|full) rspec …
View spec_helper.rb
mode = ENV["SPEC"] || "full"
require_relative "spec_helper_#{mode}"
bguthrie /
Created Dec 16, 2011
A brief list of activities that do not produce code.

Thanks to @mipearson for his help in compiling this extremely serious and meaningful list.

  • Drawing Visio diagrams
  • Project management
  • Standards governance
  • Analyzing technical requirements
  • Attending meetings
  • Tweeting
  • Drinking
  • Writing gists
View gist:308216
set -u
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
You can’t perform that action at this time.