https://github.com/visionmedia/mocha/blob/master/lib/hook.js
It boils down to something like this:
"use strict";
function MyClass(arg1) {
this.instanceVariable = arg1;
// stuff
}
require 'set' | |
require 'csv' | |
data_path = '/Users/zach/Code/metrics_loader/data/' | |
$hits_path = "#{data_path}/analytic_recording_tags_20121216.csv" | |
$recordings_path = "#{data_path}/recordings_20121216.csv" | |
$raw_ids = Set.new | |
IO.foreach($hits_path).each do |line| | |
next if(ids = line.slice!(0, 13)) == 'record_ident|' |
window.app.views.BodyView = Backbone.View.extend({ | |
el: $("body"), | |
events: { | |
"click #app-submit": "save", | |
}, | |
save: function () { | |
var lineItem = $('#line-item').val() | |
this.model.saveWithFormat(lineItem) | |
} | |
}); |
# From Spotlight, search for terminal | |
# From the terminal, type irb to start the Interactive Ruby shell | |
# To leave irb, type exit | |
# If shit gets weird, control-c | |
############################################ | |
# Words for Mary | |
# Special words | |
# while, if, puts, do, end | |
# most others are variables or numbers |
class User < ActiveRecord::Base | |
geocoded_by :address | |
def save_with_geocode | |
geocode if address_changed? | |
save | |
end | |
def address | |
address_compenents.map { |e| self.send e }.join(" ") |
## Example 3 ### | |
class Charlie | |
def hey(drivel) | |
answerer(drivel).reply | |
end | |
private |
parse: function(response){ | |
return response.notifications.map(function(e) { | |
return e.notification; | |
}); | |
}, |
https://github.com/visionmedia/mocha/blob/master/lib/hook.js
It boils down to something like this:
"use strict";
function MyClass(arg1) {
this.instanceVariable = arg1;
// stuff
}
class Today | |
WEDNESDAY = 3 | |
def self.wednesday? | |
Date.today.wday == WEDNESDAY | |
end | |
end |
Maintenance is the primary cost of software systems. What we build is brittle and ill suited for even minor changes.
Maintenance as a % of the total cost by decade.
The consequence of this is an exponential increase in the cost of building systems as they grow.
It is quite possible to instrument and collect timings from our front end code. Suddenly we've got just as much insight into our frontend code as our backend and optimize accordingly.
We want to use the native browser performance api where possible and fall back to Date.now()
when it's not. Luckily a polyfill library exists already - User Timing
The first step is to instrument the actual JavaScript.
toggleAllComplete: function () {
var elapsedTime,