Skip to content

Instantly share code, notes, and snippets.

View awright415's full-sized avatar

Adam Wright awright415

View GitHub Profile
@staltz
staltz / introrx.md
Last active May 9, 2024 07:59
The introduction to Reactive Programming you've been missing
anonymous
anonymous / clickmap.js
Created August 14, 2012 13:30
$(document).ready(function() {
// create canvas
var canvas = document.createElement("canvas");
canvas.height = 300; // important! because default canvas size is 300x150
var ctx = canvas.getContext('2d');
// create img
var img = document.createElement("img");
// IMPORTANT adding shadow map - each area has different background color
@mnutt
mnutt / Instrument Anything in Rails 3.md
Created September 6, 2010 06:50
How to use Rails 3.0's new notification system to inject custom log events

Instrument Anything in Rails 3

With Rails 3.0 released a few weeks ago I've migrated a few apps and I'm constantly finding useful new improvements. One such improvement is the ability to log anything in the same way that Rails internally logs ActiveRecord and ActionView. By default Rails 3 logs look slightly spiffier than those produced by Rails 2.3: (notice the second line has been cleaned up)

Started GET "/" for 127.0.0.1 at Mon Sep 06 01:07:11 -0400 2010
  Processing by HomeController#index as HTML
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1
  CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1

Rendered layouts/_nav.html.erb (363.4ms)