- A web page is just a text file
- html > body > hello world
- definition of markup
- the HTML is invisible
- heading
module Sandbox | |
def self.add_class(klass) | |
const_set_from_string(klass) | |
end | |
def self.add_attributes(klass, *attrs) | |
self.const_get_from_string(klass).class_eval do | |
attr_accessor *attrs | |
# set up the 'initialize' method to assign the attributes |
if ENV['RAILS_ENV'] | |
rails_env = ENV['RAILS_ENV'].downcase | |
elsif Rails and Rails.env | |
rails_env = Rails.env.downcase | |
end | |
if rails_env | |
current_app = "myapp" | |
black = "\[\033[0;30m\]" |
module OrderCollectionExtension | |
def revenue | |
self.sum(:payment_total_in_cents) | |
end | |
end | |
Order.non_zero_price.extend(OrderCollectionExtension).revenue |
module Discountable | |
def to_discount_code | |
DiscountCode.find_by_code(self) | |
end | |
end | |
class DiscountCode < ActiveRecord::Base | |
def to_discount_code | |
self | |
end |
"Change it until it works" used to be how I approached | |
metaprogramming - the ruby equivalent of kicking the | |
tires until the car starts. In this talk we'll gingerly | |
lift the hood and take a look at what's under there. | |
We'll start with a high-level overview to get some | |
context but quickly move on to various ways of inspecting | |
and manipulating objects, classes, and the metaclass. | |
You'll leave with a set of tools and techniques to make | |
metaprogramming more tangible and explorable. |
desc "Pings PING_URL to keep a dyno alive" | |
task :dyno_ping do | |
require "net/http" | |
if ENV['PING_URL'] | |
puts "Pinging #{ENV['PING_URL']}" | |
uri = URI(ENV['PING_URL']) | |
Net::HTTP.get_response(uri) | |
end | |
end |
<html> | |
<head> | |
<script type="text/javascript"> | |
/*! jQuery v2.0.1 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license | |
//@ sourceMappingURL=jquery-2.0.1.min.map | |
*/ | |
(function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],f="2.0.1",p=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=f.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^-ms-/,N=/-([\da-z])/gi,E=function(e,t){return t.toUpperCase()},S=function(){o.removeEventListener("DOMContentLoaded",S,!1),e.removeEventListener("load",S,!1),x.ready()};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,t,n){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:T.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if( |
class Bob | |
def hey(message) | |
message ||= "" | |
message = Message.new(message) | |
case | |
when message.shouting? | |
"Woah, chill out!" | |
when message.question? |
I have found these resources particularly helpful in preparing this posting: | |
Hiring Engineers, a Process | |
http://hueniverse.com/2013/02/hiring-engineers-a-process/ | |
Join the Lift Team | |
http://blog.lift.do/post/24988178079/join-the-lift-team | |
How Etsy Increased Diversity in Its Engineering Department: An Interview with Marc Hedlund | |
https://www.youtube.com/watch?v=0D66GVc7ztA |