Top Banner
Ken Collins metaskills.net _H@<k@th0n_ Monday, September 12, 11
54

Dominion Enterprises _H@

Aug 20, 2015

Download

Technology

Ken Collins
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Dominion Enterprises _H@

Ken Collinsmetaskills.net

_H@<k@th0n_

Monday, September 12, 11

Page 2: Dominion Enterprises _H@

Who Am I Again?

?Monday, September 12, 11

Page 3: Dominion Enterprises _H@

Who Am I Again?

@MetaSkills

Monday, September 12, 11

Page 4: Dominion Enterprises _H@

Who Am I Again?

@MetaSkills

Monday, September 12, 11

Page 5: Dominion Enterprises _H@

Who Am I Again?

@MetaSkills

Monday, September 12, 11

Page 6: Dominion Enterprises _H@

Who Am I Again?

@MetaSkills

Monday, September 12, 11

Page 7: Dominion Enterprises _H@

Who Am I Again?

@MetaSkills

...

Monday, September 12, 11

Page 8: Dominion Enterprises _H@

Sr. Software Engineer @ Decisiv

Monday, September 12, 11

Page 9: Dominion Enterprises _H@

Monday, September 12, 11

Page 10: Dominion Enterprises _H@

JavaScript

Monday, September 12, 11

Page 11: Dominion Enterprises _H@

Monday, September 12, 11

Page 12: Dominion Enterprises _H@

Blog @ MetaSkills.net

Monday, September 12, 11

Page 13: Dominion Enterprises _H@

Freetime @ HomeMarks.com

Monday, September 12, 11

Page 14: Dominion Enterprises _H@

Advocate @ 757rb.org

Monday, September 12, 11

Page 15: Dominion Enterprises _H@

HTML5CSS3

Monday, September 12, 11

Page 16: Dominion Enterprises _H@

Divitis

<div id="post"> <div id="header"> <span class="pubdate"> <span class="day">27</span> <span class="month">Dec</span> <span class="year">2010</span> </span> <h1>My New Blog</h1> </div> ... <div id="disqus_thread"> ... </div></div>

Monday, September 12, 11

Page 17: Dominion Enterprises _H@

Semantic

<article id="post"> <header> <time pubdate datetime="2010-12-27T00:00:00-05:00"> <span class="day">27</span> <span class="month">Dec</span> <span class="year">2010</span> </time> <h1>My New Blog</h1> </header> ... <footer id="disqus_thread"> ... </footer></article>

Monday, September 12, 11

Page 18: Dominion Enterprises _H@

Dive Into HTML5

http://diveintohtml5.org/semantics.html#new-elements

Monday, September 12, 11

Page 19: Dominion Enterprises _H@

CSS3

Monday, September 12, 11

Page 20: Dominion Enterprises _H@

CSS3Selectors

Monday, September 12, 11

Page 21: Dominion Enterprises _H@

CSS3SelectorsBorders (images, radius, shadows)

Monday, September 12, 11

Page 22: Dominion Enterprises _H@

CSS3SelectorsBorders (images, radius, shadows)Colors (rgba, hsla, opacity)

Monday, September 12, 11

Page 23: Dominion Enterprises _H@

CSS3SelectorsBorders (images, radius, shadows)Colors (rgba, hsla, opacity)Text (wrap, overlay, shadows)

Monday, September 12, 11

Page 24: Dominion Enterprises _H@

CSS3SelectorsBorders (images, radius, shadows)Colors (rgba, hsla, opacity)Text (wrap, overlay, shadows)Backgrounds (gradients, clip, origin)

Monday, September 12, 11

Page 25: Dominion Enterprises _H@

CSS3SelectorsBorders (images, radius, shadows)Colors (rgba, hsla, opacity)Text (wrap, overlay, shadows)Backgrounds (gradients, clip, origin)Media Queries & Fonts

Monday, September 12, 11

Page 26: Dominion Enterprises _H@

Transitions, Transforms, Animations

Monday, September 12, 11

Page 27: Dominion Enterprises _H@

Transitions, Transforms, Animations

Monday, September 12, 11

Page 28: Dominion Enterprises _H@

jQuery “Mobile”

Monday, September 12, 11

Page 29: Dominion Enterprises _H@

Encapsulate Your JavaScript

http://metaskills.net/2011/09/06/how-do-you-encapsulate-your-javascript/

Monday, September 12, 11

Page 30: Dominion Enterprises _H@

Leveraging API's In Ruby

Monday, September 12, 11

Page 31: Dominion Enterprises _H@

Data Format (JSON & XML)

Monday, September 12, 11

Page 32: Dominion Enterprises _H@

Data Format (JSON & XML)Always Use Object Notation

Monday, September 12, 11

Page 33: Dominion Enterprises _H@

Data Format (JSON & XML){ "id":8, "email":"[email protected]", "posts":[ {"id":30, "title":"First Post", "body":"Some text..."}, {"id":73, "title":"Second Post", "body":"More text..."} ]}

Monday, September 12, 11

Page 34: Dominion Enterprises _H@

<user> <id type="integer">8</id> <email>[email protected]</email> <posts type="array"> <post> <id type="integer">30</id> <title>First Post</title> <body>Some text...</body> </post> <post> <id type="integer">73</id> <title>Second Post</title> <body>More text...</body> </post> </posts></user>

Data Format (JSON & XML)

Monday, September 12, 11

Page 35: Dominion Enterprises _H@

Data Format (JSON & XML)Always Use Object NotationRails has #to_json and #to_xmlDefine #as_json for obj primitive.

Monday, September 12, 11

Page 36: Dominion Enterprises _H@

Data Format (JSON & XML)Always Use Object NotationRails has #to_json and #to_xmlDefine #as_json for obj primitive.New objects using #from_json and #from_xml methods.

Monday, September 12, 11

Page 37: Dominion Enterprises _H@

json = '{ "id":8, "email":"[email protected]", "posts":[ {"id":30, "title":"First Post", "body":"Some text..."}, {"id":73, "title":"Second Post", "body":"More text..."} ]}'

user = User.new.from_json(json)user.email # => [email protected] # => 2user.post.first.title # => "First Post"

Data Format (JSON & XML)

Monday, September 12, 11

Page 38: Dominion Enterprises _H@

Representation State Transfer

(REST)

Monday, September 12, 11

Page 39: Dominion Enterprises _H@

Representation State Transfer

(REST)CREATE READ UPDATE DELETE

DB

HTTP

INSERT SELECT UPDATE DELETE

POST GET PUT DELETE

Monday, September 12, 11

Page 40: Dominion Enterprises _H@

Representation State Transfer

(REST)CREATE READ UPDATE DELETE

DB

HTTP

INSERT SELECT UPDATE DELETE

POST GET PUT DELETE

Monday, September 12, 11

Page 41: Dominion Enterprises _H@

Representation State Transfer

(REST)CREATE READ UPDATE DELETE

DB

HTTP

INSERT SELECT UPDATE DELETE

POST GET PUT DELETE

Monday, September 12, 11

Page 42: Dominion Enterprises _H@

Representation State Transfer

(REST)GET /users {:controller=>"users", :action=>"index"}POST /users {:controller=>"users", :action=>"create"}GET /users/:id {:controller=>"users", :action=>"show"}PUT /users/:id {:controller=>"users", :action=>"update"} DELETE /users/:id {:controller=>"users", :action=>"destroy"}

Monday, September 12, 11

Page 43: Dominion Enterprises _H@

HTTP Clients

Monday, September 12, 11

Page 44: Dominion Enterprises _H@

HTTP Clients In Ruby

Monday, September 12, 11

Page 45: Dominion Enterprises _H@

HTTP Clients In RubyMany choices!

Monday, September 12, 11

Page 46: Dominion Enterprises _H@

HTTP Clients In RubyMany choices! Ruby’s core lib Net::HTTP looks more like wizardry vs idiomatic Ruby.

Monday, September 12, 11

Page 47: Dominion Enterprises _H@

HTTP Clients In RubyMany choices! Ruby’s core lib Net::HTTP looks more like wizardry vs idiomatic Ruby.Research and pick one that works best for you.

Monday, September 12, 11

Page 48: Dominion Enterprises _H@

HTTP Clients In Ruby

http://ruby-toolbox.com/categories/http_clients.html

Monday, September 12, 11

Page 49: Dominion Enterprises _H@

Typhoeus

https://github.com/dbalatero/typhoeus

High Speed!Built On Top Of libcurlSimple RESTful RequestParallel RequestsMemoization & Caching

Monday, September 12, 11

Page 50: Dominion Enterprises _H@

hydra = Typhoeus::Hydra.newrequest = Typhoeus::Request.new("http://localhost/posts/1.json")request.on_complete do |response| json = JSON.parse(response.body) post = Post.new.from_json(json) # Do crazy callback stuff...end

hydra.queue requesthydra.run # This is a blocking call that # returns once all requests are complete.

Typhoeus

Monday, September 12, 11

Page 51: Dominion Enterprises _H@

SOAP

Monday, September 12, 11

Page 52: Dominion Enterprises _H@

xml = Builder::XmlMarkup.new(:indent=>2)xml.user do xml.id 8, :type => 'integer' xml.email "[email protected]" xml.posts :type => 'array' do xml.post {...} endendxml.target! # => # <user> # <id type="integer">8</id> # <email>[email protected]</email> # <posts type="array"> # <post> # ... # </post> # </posts> # </user>

Pragmatic Use Of Builder

http://builder.rubyforge.org/

Monday, September 12, 11

Page 53: Dominion Enterprises _H@

If You Embrace SOAP

http://savonrb.com/ https://github.com/unwire/handsoap

Savon Handsoap

Monday, September 12, 11

Page 54: Dominion Enterprises _H@

Thanks!Ken Collins

metaskills.net

Monday, September 12, 11