Slide 1

Slide 1 text

Front-end WEB DEVELOPMENT with Ruby maTT BUCK @TECHPEACE

Slide 2

Slide 2 text

A (very) Little About Me

Slide 3

Slide 3 text

current gig

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

previous gigs

Slide 8

Slide 8 text

Learn you a for great job Ruby

Slide 9

Slide 9 text

Coder’s The Front-end Predicament

Slide 10

Slide 10 text

1995 2000 2005 2010 You Oughta Know Source: evolutionoftheweb.com

Slide 11

Slide 11 text

1995 2000 2005 2010 You Oughta Know 1995 HTML 2 Source: evolutionoftheweb.com

Slide 12

Slide 12 text

1995 2000 2005 2010 You Oughta Know 1995 HTML 2 1997 CSS 2 JavaScript Source: evolutionoftheweb.com

Slide 13

Slide 13 text

1995 2000 2005 2010 You Oughta Know 1995 HTML 2 1997 CSS 2 JavaScript Source: evolutionoftheweb.com 2005 AJAX

Slide 14

Slide 14 text

1995 2000 2005 2010 You Oughta Know 1995 HTML 2 1997 CSS 2 JavaScript Source: evolutionoftheweb.com 2007 Mobile 2005 AJAX

Slide 15

Slide 15 text

1995 2000 2005 2010 You Oughta Know 1995 HTML 2 1997 CSS 2 JavaScript Source: evolutionoftheweb.com 2007 Mobile 2013 CSS 3 HTML5 2005 AJAX

Slide 16

Slide 16 text

1995 2000 2005 2010 You Oughta Know Source: evolutionoftheweb.com 2013 CSS 3 HTML5

Slide 17

Slide 17 text

You Oughta Know 2013 CSS 3 Animation 2D/3D transforms Fonts

Slide 18

Slide 18 text

You Oughta Know 2013 CSS 3 Animation 2D/3D transforms Fonts HTML5 Semantic elements Local storage Video/audio Geolocation Drag and drop

Slide 19

Slide 19 text

You Oughta Know 2013 CSS 3 Animation 2D/3D transforms Fonts JavaScript MVC AMD CoffeeScript HTML5 Semantic elements Local storage Video/audio Geolocation Drag and drop

Slide 20

Slide 20 text

You Oughta Know 2013 responsive design accessibility canvas WebGL WebSocket

Slide 21

Slide 21 text

You Oughta Know 2013 minification linting asset packaging responsive design accessibility canvas WebGL WebSocket pushState templating

Slide 22

Slide 22 text

You Oughta Know 2013 minification linting asset packaging responsive design accessibility canvas WebGL WebSocket pushState templating jQuery Modernizr Twitter Bootstrap HTML5 Boilerplate RequireJS UglifyJS Underscore

Slide 23

Slide 23 text

Everybody HATES tag clouds

Slide 24

Slide 24 text

RECAP The explosive growth of the web has dramatically increased the complexity of front-end development

Slide 25

Slide 25 text

Markup: There has to be a better way

Slide 26

Slide 26 text

This doesn't seem right.

Slide 27

Slide 27 text

  • Now I'm very concerned.

Slide 28

Slide 28 text

  • Now I'm very concerned.
Do I have to?

Slide 29

Slide 29 text

Markaby Markup as Ruby div.menu do %w[5.gets bits inspect cult -h].map do |m| capture { link_to m, "/#{m}" } end.join(" | ") end

Slide 30

Slide 30 text

Markaby Markup as Ruby
  • Now I'm very concerned.

Slide 31

Slide 31 text

Markaby Markup as Ruby div do ul do li do span "Still a bit concerned." end end end

Slide 32

Slide 32 text

Markaby Markup as Ruby div do ul do li do span "Still a bit concerned." end end end

Slide 33

Slide 33 text

div do ul do li do span "Still a bit concerned." end end end

Slide 34

Slide 34 text

%div %ul %li %span That's better. Haml

Slide 35

Slide 35 text

#comments %ul.fancy %li %span{style: 'color: green;'} That's better. Haml

Slide 36

Slide 36 text

#comments ul.fancy li span style='color: green;' That's better. slim

Slide 37

Slide 37 text

RECAP HTML Markaby Haml slim good terse terser tersest

Slide 38

Slide 38 text

Stylesheets: I know I put that selector here someplace

Slide 39

Slide 39 text

nav ul { list-style: none; } nav ul li { color: red; font-weight: bold; font-style: serif; font-size: 12px; } h1 { color: red; } CSS

Slide 40

Slide 40 text

nav ul { list-style: none; } nav ul li { color: red; font-weight: bold; font-style: serif; font-size: 12px; } h1 { color: red; } CSS

Slide 41

Slide 41 text

nav ul { list-style: none; } nav ul li { color: red; font-weight: bold; font-style: serif; font-size: 12px; } h1 { color: red; } CSS

Slide 42

Slide 42 text

nav ul { list-style: none; } nav ul li { color: red; font-weight: bold; font-style: serif; font-size: 12px; } h1 { color: red; } CSS

Slide 43

Slide 43 text

nav ul { list-style: none; } nav ul li { color: red; font-weight: bold; font-style: serif; font-size: 12px; } h1 { color: red; } CSS $text-color: red; nav { ul { list-style: none; li { color: $text-color; font: { weight: bold; style: serif; size: 12px; } } } } h1 { color: $text-color; } SCSS

Slide 44

Slide 44 text

nav ul { list-style: none; } nav ul li { color: red; font-weight: bold; font-style: serif; font-size: 12px; } h1 { color: red; } CSS $text-color: red; nav { ul { list-style: none; li { color: $text-color; font: { weight: bold; style: serif; size: 12px; } } } } h1 { color: $text-color; } SCSS

Slide 45

Slide 45 text

nav ul { list-style: none; } nav ul li { color: red; font-weight: bold; font-style: serif; font-size: 12px; } h1 { color: red; } CSS $text-color: red; nav { ul { list-style: none; li { color: $text-color; font: { weight: bold; style: serif; size: 12px; } } } } h1 { color: $text-color; } SCSS

Slide 46

Slide 46 text

nav ul { list-style: none; } nav ul li { color: red; font-weight: bold; font-style: serif; font-size: 12px; } h1 { color: red; } CSS $text-color: red; nav { ul { list-style: none; li { color: $text-color; font: { weight: bold; style: serif; size: 12px; } } } } h1 { color: $text-color; } SCSS

Slide 47

Slide 47 text

nav ul { list-style: none; } nav ul li { color: red; font-weight: bold; font-style: serif; font-size: 12px; } h1 { color: red; } CSS $text-color: red; nav { ul { list-style: none; li { color: $text-color; font: { weight: bold; style: serif; size: 12px; } } } } h1 { color: $text-color; } SCSS

Slide 48

Slide 48 text

nav ul { list-style: none; } nav ul li { color: red; font-weight: bold; font-style: serif; font-size: 12px; } h1 { color: red; } CSS $text-color: red; nav { ul { list-style: none; li { color: $text-color; font: { weight: bold; style: serif; size: 12px; } } } } h1 { color: $text-color; } SCSS

Slide 49

Slide 49 text

Sass Variables $green: #67917A; $border-width: 5px; .callout { border: { width: $border-width * 2; color: darken($green, 30%); } }

Slide 50

Slide 50 text

Sass Mixins @mixin index-table { th { font-weight: bold; } tr:nth-child(2n) { background-color: #e2e2e2; } } table.users { @include index-table; }

Slide 51

Slide 51 text

= Sass + CSS3 mixins + layouts + typography patterns +

Slide 52

Slide 52 text

Compass CSS3 .rounded { @include border-radius; } SCSS

Slide 53

Slide 53 text

Compass CSS3 .rounded { -webkit-border-radius: 5px 5px; -moz-border-radius: 5px / 5px; -khtml-border-radius: 5px / 5px; border-radius: 5px / 5px; } CSS

Slide 54

Slide 54 text

Compass CSS3 Appearance Background Clip Background Origin Background Size Border Radius Box Box Shadow Box Sizing Columns Filter Font Face Hyphenation Images Inline Block Opacity CSS Regions Text Shadow Transform / Transition

Slide 55

Slide 55 text

Madness!

Slide 56

Slide 56 text

aside h2 Keynote Speakers ul li Matz li Uncle Bob slim Source: “Help, My Stylesheets are a Mess!” - Chriss Eppstein

Slide 57

Slide 57 text

SCSS Source: “Help, My Stylesheets are a Mess!” - Chriss Eppstein aside { $dark-blue: #234767; $light-blue: #7ED4ED; background-color: $dark-blue; border: 2px solid lighten($dark-blue, 40%); color: $light-blue; font-family: 'Helvetica Neue'; @include box-shadow; margin: 15px; padding: 15px; h2 { font-weight: bold; font-size: 1.5em; } ul { list-style: square; margin: 15px 20px; } }

Slide 58

Slide 58 text

Source: “Help, My Stylesheets are a Mess!” - Chris Eppstein aside { $dark-blue: #234767; $light-blue: #7ED4ED; background-color: $dark-blue; border: 2px solid lighten($dark-blue, 40%); color: $light-blue; font-family: 'Helvetica Neue'; @include box-shadow; margin: 15px; padding: 15px; h2 { font-weight: bold; font-size: 1.5em; } ul { list-style: square; margin: 15px 20px; } }

Slide 59

Slide 59 text

Source: “Help, My Stylesheets are a Mess!” - Chris Eppstein aside { $dark-blue: #234767; $light-blue: #7ED4ED; background-color: $dark-blue; border: 2px solid lighten($dark-blue, 40%); color: $light-blue; font-family: 'Helvetica Neue'; @include box-shadow; margin: 15px; padding: 15px; h2 { font-weight: bold; font-size: 1.5em; } ul { list-style: square; margin: 15px 20px; } }

Slide 60

Slide 60 text

Source: “Help, My Stylesheets are a Mess!” - Chris Eppstein aside { $dark-blue: #234767; $light-blue: #7ED4ED; background-color: $dark-blue; border: 2px solid lighten($dark-blue, 40%); color: $light-blue; font-family: 'Helvetica Neue'; @include box-shadow; margin: 15px; padding: 15px; h2 { font-weight: bold; font-size: 1.5em; } ul { list-style: square; margin: 15px 20px; } }

Slide 61

Slide 61 text

Source: “Help, My Stylesheets are a Mess!” - Chris Eppstein aside { $dark-blue: #234767; $light-blue: #7ED4ED; background-color: $dark-blue; border: 2px solid lighten($dark-blue, 40%); color: $light-blue; font-family: 'Helvetica Neue'; @include box-shadow; margin: 15px; padding: 15px; h2 { font-weight: bold; font-size: 1.5em; } ul { list-style: square; margin: 15px 20px; } }

Slide 62

Slide 62 text

Source: “Help, My Stylesheets are a Mess!” - Chris Eppstein aside { @extend .highlight-text; } .highlight-text { font-family: 'Helvetica Neue'; h2 { font-weight: bold; font-size: 1.5em; } } Typography

Slide 63

Slide 63 text

Container .shadow-box { @include box-shadow; border: 2px solid lighten($dark-blue, 40%); margin: 15px; padding: 15px; } Source: “Help, My Stylesheets are a Mess!” - Chris Eppstein

Slide 64

Slide 64 text

Color .dark-background { background-color: $dark-blue; } .high-contrast { color: $light-blue; } Source: “Help, My Stylesheets are a Mess!” - Chris Eppstein

Slide 65

Slide 65 text

aside { @extend .highlight-text; @extend .shadow-box; @extend .dark-background; @extend .high-contrast; ul { list-style: square; margin: 15px 20px; } } Source: “Help, My Stylesheets are a Mess!” - Chris Eppstein

Slide 66

Slide 66 text

$ compass create mysite --using blueprint

Slide 67

Slide 67 text

RECAP Use SCSS and Compass to organize properties:

Slide 68

Slide 68 text

RECAP Use SCSS and Compass to organize properties: container

Slide 69

Slide 69 text

RECAP Use SCSS and Compass to organize properties: container color

Slide 70

Slide 70 text

RECAP Use SCSS and Compass to organize properties: container color typography

Slide 71

Slide 71 text

Automation: Flow my work, the policeman said

Slide 72

Slide 72 text

guard filesystem watcher

Slide 73

Slide 73 text

Source: Viget Extend - “Ruby Tools for Non-Ruby Projects” guard 'slim' do watch /^.+\.slim$/ end guard 'compass' do watch /^.+(\.scss)/ end Guardfile

Slide 74

Slide 74 text

Source: Viget Extend - “Ruby Tools for Non-Ruby Projects” $ bundle install $ bundle exec guard

Slide 75

Slide 75 text

guard wants to do these things for you: compile CoffeeScript compile Haml livereload run hinters/linters run Jasmine tests

Slide 76

Slide 76 text

vizr MassRelevance/vizr

Slide 77

Slide 77 text

JavaScript workflow automation

Slide 78

Slide 78 text

grunt

Slide 79

Slide 79 text

bower $ npm install -g bower $ bower install $ bower install underscore

Slide 80

Slide 80 text

yeoman $ yo webapp $ npm install && bower install $ bower install underscore $ grunt

Slide 81

Slide 81 text

RECAP Use Guard to automate workflow, delve into JavaScript, or build your own gem

Slide 82

Slide 82 text

Static sites: Putting it all together, now

Slide 83

Slide 83 text

jekyll _config.yml _posts/ $ jekyll --server

Slide 84

Slide 84 text

Octopress

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

Middleman

Slide 88

Slide 88 text

Middleman + Padrino

Slide 89

Slide 89 text

Middleman + Padrino templates partials layouts helpers

Slide 90

Slide 90 text

techpeace/api-site-base api-site-base

Slide 91

Slide 91 text

$ compass create api-site-base -r bootstrap-sass --using bootstrap $ middleman init api-site-base

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

1 doctype html 2 html 3 head 4 meta charset="utf-8" 5 6 /! Always force latest IE rendering engine or request Chrome Frame 7 meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" 8 9 /! Use title if it's in the page YAML frontmatter 10 title = data.page.title || "The Middleman" 11 12 == stylesheet_link_tag "styles" 13 == javascript_include_tag "all" 14 15 body class=page_classes 16 == partial 'navbar' 17 18 .container 19 == yield 20 21 .footer 22 .row 23 .span12 24 | ©2012 Product 25 layout.slim

Slide 94

Slide 94 text

body class=page_classes == partial 'navbar' Partials

Slide 95

Slide 95 text

.row .span12 h1 Product API Documentation .row .span12 p = lorem.sentences 7 .row.wells == well 'Documentation', 'settings.png', 'Read the docs' == well 'Examples', 'screen.png', 'Read some code' == well 'Getting Started', 'globe.png', 'Write some code' index.html.slim Templates

Slide 96

Slide 96 text

layout.slim Templates .container == yield

Slide 97

Slide 97 text

.row.wells == well 'Documentation', 'settings.png', 'Read the docs' == well 'Examples', 'screen.png', 'Read some code' == well 'Getting Started', 'globe.png', 'Write some code' index.html.slim

Slide 98

Slide 98 text

lorem.sentences 3 Lorem Helpers

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

You’ve got options... high_voltage Nanoc stasis Webby Frank StaticMatic brochure ruhoh Bonsai Webgen Korma Dynamicmatic Ace machined deplot Source: ruby-toolbox.com

Slide 101

Slide 101 text

Backend as a Service

Slide 102

Slide 102 text

Backend as a Service Parse

Slide 103

Slide 103 text

Backend as a Service Parse

Slide 104

Slide 104 text

TodoMVC

Slide 105

Slide 105 text

TodoMVC

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

techpeace/todomvc-parse

Slide 108

Slide 108 text

Parse.initialize("LjeawWUFxAcVb1QAIwqV2mbh9c2keODx73rYkISk", "vmmYKly7zibzYvZ70WQvFc7UB64pgPJ7aT41317c");

Slide 109

Slide 109 text

app.Todo = Backbone.Model.extend({ defaults: { title: '', completed: false }, toggle: function() { this.save({ completed: !this.get('completed') }); } });

Slide 110

Slide 110 text

app.Todo = Parse.Object.extend({ // Map this model to the appropriate // Parse class. className: "Todo", defaults: { title: '', completed: false }, toggle: function() { this.save({ completed: !this.get('completed') }); } });

Slide 111

Slide 111 text

app.Todo = Parse.Object.extend({ // Map this model to the appropriate // Parse class. className: "Todo", defaults: { title: '', completed: false }, toggle: function() { this.save({ completed: !this.get('completed') }); } });

Slide 112

Slide 112 text

app.Todo = Parse.Object.extend({ // Map this model to the appropriate // Parse class. className: "Todo", defaults: { title: '', completed: false }, toggle: function() { this.save({ completed: !this.get('completed') }); } });

Slide 113

Slide 113 text

var TodoList = Backbone.Collection.extend({

Slide 114

Slide 114 text

var TodoList = Parse.Collection.extend({

Slide 115

Slide 115 text

STEP 4 MISSING

Slide 116

Slide 116 text

Deployment

Slide 117

Slide 117 text

Behold: todo.matthewbuck.com

Slide 118

Slide 118 text

Backlift

Slide 119

Slide 119 text

Backlift

Slide 120

Slide 120 text

Backlift

Slide 121

Slide 121 text

Backlift

Slide 122

Slide 122 text

Backlift

Slide 123

Slide 123 text

Backlift

Slide 124

Slide 124 text

Backlift

Slide 125

Slide 125 text

Backlift

Slide 126

Slide 126 text

No content

Slide 127

Slide 127 text

No content

Slide 128

Slide 128 text

Backlift

Slide 129

Slide 129 text

RECAP jekyll Octopress Middleman Parse/Backlift GitHub page blog static site “static” site

Slide 130

Slide 130 text

fin

Slide 131

Slide 131 text

Credits sketches color scheme fonts _why www.colourlovers.com/palette/ 559428/lucky_bubble_gum Amaranth Economica Capture IT Impact Label Inconsolata This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.