Skip to content

Instantly share code, notes, and snippets.

View chrismytton's full-sized avatar

Chris Mytton chrismytton

View GitHub Profile
@chrismytton
chrismytton / ideas_generator.rb
Created May 16, 2010 23:10
For when you just don't know what to do
module Idea
class Generator
def actions
@actions ||= %w{read write design contemplate}
end
def objects
@objects ||= ['code', 'books', 'art', 'poetry', 'blogs']
end
// bookmarklet to introspect the source of current page
javascript:(function(d,h){h=d.documentElement.innerHTML;d.open();d.write('<pre>'+('<!DOCTYPE html><html>'+h+'</html>').replace(/[<>]/g,function(m){return{'<':'&lt;','>':'&gt;'}[m]})+'</pre>')})(document);
var calculator = {
add: function (a, b) {
return a + b
},
subtract: function (a, b) {
return a - b
},
multiply: function (a, b) {
return a * b
},