SlideShare a Scribd company logo
 
Why code in Ruby / Rails?
 
I like Java
+ Sign me up!
But I like Ruby better.
Brevity.
import java.util.Map; import java.util.HashMap; ...   Map<Integer, String> hash =  new  HashMap<Integer, String>();     hash.put(1,  &quot;one&quot; );   hash.put(2,  &quot;two&quot; );   hash.put(3,  &quot;three&quot; );
hash = {  1  =>  &quot; one &quot; ,  2  =>  &quot; two &quot; ,  3  =>  &quot; three &quot;  }
Rails is (mostly) concise.
$ rails blog $ cd blog $ ruby script/generate scaffold entry subject:string content:text $ rake db:migrate  $ ruby script/server
class   Entry  <  ActiveRecord :: Base end
class   EntriesController  <  ApplicationController # GET /entries # GET /entries.xml def   index @entries  =  Entry .all respond_to  do  | format | format.html  # index.html.erb format.xml  { render  :xml  =>  @entries  } end end ...
< h1 > Listing entries </ h1 > < table > < tr > < th > Subject </ th > < th > Content </ th > </ tr > <%   @entries .each  do  | entry |  %> < tr > < td > <%= h entry.subject  %> </ td > < td > <%= h entry.content  %> </ td > < td > <%=  link_to ' Show ', entry  %> </ td > < td > <%=  link_to ' Edit ', edit_entry_path(entry)  %> </ td > < td > <%=  link_to ' Destroy ', entry,  :confirm  =>  ' Are you sure? ' ,  :method  =>  :delete   %> </ td > </ tr > <%   end   %> </ table > < br   /> <%=  link_to ' New entry ', new_entry_path  %>
HTML in ERb screws everything up.
import java.util.Map; import java.util.HashMap; ...   Map<Integer, String>  hash = new  HashMap<Integer, String>();     hash.put( 1,  &quot;one&quot; );   hash.put( 2,  &quot;two&quot; );   hash.put( 3,  &quot;three&quot; ); Ruby does away with redundant code
What if we could do it here too? < h1 > Listing entries </h1> < table >   < tr >   < th > Subject </th>   < th > Content </th>   </tr> <%  @entries.each do |entry|  %>   < tr >   < td ><% =h entry.subject  %></td>   < td ><% =h entry.content  %></td>   < td ><% = link_to 'Show', entry  %></td>   < td ><% = link_to 'Edit', edit_entry_path(entry)  %></td>   < td ><% = link_to 'Destroy', entry, :confirm => 'Are you sure?', :method => :delete  %></td>   </tr> <% end %> </table>   < br  />   <% = link_to 'New entry', new_entry_path  %>
Enter  Haml
% h1  Listing entries Declaring Elements
% table % tr % th  Subject % th  Content Nesting Elements
%table %tr %th Subject %th Content -   @entries .each  do  | entry |   %tr   % td &=  entry.subject   % td &=  entry.content    % td =  link_to  ' Show ' , entry   % td =  link_to  ' Edit ' , edit_entry_path(entry)   Ruby Code
% p {   :style  =>  &quot; color: green &quot;   }=  notice Attributes
% div {  :class   =>  &quot; error &quot; ,   :id   =>  &quot; some_id &quot; }  Some Text can be shortened to . class # some_id  Some Text divs, classes, and id
Why stop at ERb?
Sass  does with  CSS what  Haml  does with  HTML .
pre   background-color :  #eee padding :  10px font-size :  11px No braces! No semicolons!
# errorExplanation width: 400px border: 2px solid red padding: 7px padding-bottom: 12px margin-bottom: 20px background-color: #f0f0f0 h2 text-align: left font-weight: bold ... Nested Selectors!
$fore:  # 333 $bg:  # fff body background-color : $bg color : $fore  Constants!
@mixin rounded($radius: 10px) border-radius: $radius -moz-border-radius: $radius -webkit-border-radius: $radius . fieldWithErrors @include rounded(5px) ... # errorExplanation @include rounded ...  Method-like structures!
Short Demo
Thank you for listening! my site:  http://www.bryanbibat.net

More Related Content

What's hot

Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching Resurrected
Ben Scofield
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With Blogging
Takatsugu Shigeta
 
Facebook Developer Garage London, Craig Ulliott, Where I've Been
Facebook Developer Garage London, Craig Ulliott, Where I've BeenFacebook Developer Garage London, Craig Ulliott, Where I've Been
Facebook Developer Garage London, Craig Ulliott, Where I've Been
Craig Ulliott
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
brynary
 
Html5 structure tags
Html5 structure tagsHtml5 structure tags
Html5 structure tags
SEO SKills
 
Html5: What is it?
Html5: What is it? Html5: What is it?
Html5: What is it?
joeydehnert
 
Html basics IML 140 (weeks 2-3)
Html basics IML 140 (weeks 2-3)Html basics IML 140 (weeks 2-3)
Html basics IML 140 (weeks 2-3)
Evan Hughes
 
Rails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity PresentationRails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity Presentation
railsconf
 
Building Secure Twitter Apps
Building Secure Twitter AppsBuilding Secure Twitter Apps
Building Secure Twitter Apps
Damon Cortesi
 
HTML all tags .........its to much helpful for beginners
HTML all tags .........its to much helpful for beginners HTML all tags .........its to much helpful for beginners
HTML all tags .........its to much helpful for beginners
Nimrakhan89
 
Findability Bliss Through Web Standards
Findability Bliss Through Web StandardsFindability Bliss Through Web Standards
Findability Bliss Through Web Standards
Aarron Walter
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on Rails
John Brunswick
 
Frontend bootcamp
Frontend bootcampFrontend bootcamp
Frontend bootcamp
SahilMore34
 
Symfony2
Symfony2Symfony2
Symfony2
mdpatrick
 
HTML 5 Simple Tutorial Part 3
HTML 5 Simple Tutorial Part 3HTML 5 Simple Tutorial Part 3
HTML 5 Simple Tutorial Part 3
Sanjeev Kumar
 
Optimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile DevicesOptimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile Devices
Sugree Phatanapherom
 
JWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAXJWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAX
Hilary Mason
 

What's hot (17)

Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching Resurrected
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With Blogging
 
Facebook Developer Garage London, Craig Ulliott, Where I've Been
Facebook Developer Garage London, Craig Ulliott, Where I've BeenFacebook Developer Garage London, Craig Ulliott, Where I've Been
Facebook Developer Garage London, Craig Ulliott, Where I've Been
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
Html5 structure tags
Html5 structure tagsHtml5 structure tags
Html5 structure tags
 
Html5: What is it?
Html5: What is it? Html5: What is it?
Html5: What is it?
 
Html basics IML 140 (weeks 2-3)
Html basics IML 140 (weeks 2-3)Html basics IML 140 (weeks 2-3)
Html basics IML 140 (weeks 2-3)
 
Rails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity PresentationRails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity Presentation
 
Building Secure Twitter Apps
Building Secure Twitter AppsBuilding Secure Twitter Apps
Building Secure Twitter Apps
 
HTML all tags .........its to much helpful for beginners
HTML all tags .........its to much helpful for beginners HTML all tags .........its to much helpful for beginners
HTML all tags .........its to much helpful for beginners
 
Findability Bliss Through Web Standards
Findability Bliss Through Web StandardsFindability Bliss Through Web Standards
Findability Bliss Through Web Standards
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on Rails
 
Frontend bootcamp
Frontend bootcampFrontend bootcamp
Frontend bootcamp
 
Symfony2
Symfony2Symfony2
Symfony2
 
HTML 5 Simple Tutorial Part 3
HTML 5 Simple Tutorial Part 3HTML 5 Simple Tutorial Part 3
HTML 5 Simple Tutorial Part 3
 
Optimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile DevicesOptimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile Devices
 
JWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAXJWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAX
 

Similar to Haml & Sass presentation

Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On Rails
Wen-Tien Chang
 
JSP Custom Tags
JSP Custom TagsJSP Custom Tags
JSP Custom Tags
BG Java EE Course
 
merb.intro
merb.intromerb.intro
merb.intro
pjb3
 
Haml, Sass & Compass
Haml, Sass & CompassHaml, Sass & Compass
Haml, Sass & Compass
László Bácsi
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
Amzad Hossain
 
Html tutorial
Html tutorialHtml tutorial
Html tutorial
mohamed ashraf
 
KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7
phuphax
 
ASP_NET Features
ASP_NET FeaturesASP_NET Features
ASP_NET Features
Biswadip Goswami
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
vikram singh
 
Html 101
Html 101Html 101
Html 101
Aldrin SuperGo
 
Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Course
mussawir20
 
JSP diana y yo
JSP diana y yoJSP diana y yo
JSP diana y yo
michael
 
Lecture 2 - Comm Lab: Web @ ITP
Lecture 2 - Comm Lab: Web @ ITPLecture 2 - Comm Lab: Web @ ITP
Lecture 2 - Comm Lab: Web @ ITP
yucefmerhi
 
Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
Yehuda Katz
 
The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page Creation
Wildan Maulana
 
Php 3 1
Php 3 1Php 3 1
PHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the GoodPHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the Good
Jeremy Kendall
 
Rails e suas Gems
Rails e suas GemsRails e suas Gems
Rails e suas Gems
Rodrigo Martins
 
Understanding THML
Understanding THMLUnderstanding THML
Understanding THML
Hinopak Motors Limited
 
Component and Event-Driven Architectures in PHP
Component and Event-Driven Architectures in PHPComponent and Event-Driven Architectures in PHP
Component and Event-Driven Architectures in PHP
Stephan Schmidt
 

Similar to Haml & Sass presentation (20)

Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On Rails
 
JSP Custom Tags
JSP Custom TagsJSP Custom Tags
JSP Custom Tags
 
merb.intro
merb.intromerb.intro
merb.intro
 
Haml, Sass & Compass
Haml, Sass & CompassHaml, Sass & Compass
Haml, Sass & Compass
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
 
Html tutorial
Html tutorialHtml tutorial
Html tutorial
 
KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7
 
ASP_NET Features
ASP_NET FeaturesASP_NET Features
ASP_NET Features
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Html 101
Html 101Html 101
Html 101
 
Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Course
 
JSP diana y yo
JSP diana y yoJSP diana y yo
JSP diana y yo
 
Lecture 2 - Comm Lab: Web @ ITP
Lecture 2 - Comm Lab: Web @ ITPLecture 2 - Comm Lab: Web @ ITP
Lecture 2 - Comm Lab: Web @ ITP
 
Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
 
The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page Creation
 
Php 3 1
Php 3 1Php 3 1
Php 3 1
 
PHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the GoodPHP 102: Out with the Bad, In with the Good
PHP 102: Out with the Bad, In with the Good
 
Rails e suas Gems
Rails e suas GemsRails e suas Gems
Rails e suas Gems
 
Understanding THML
Understanding THMLUnderstanding THML
Understanding THML
 
Component and Event-Driven Architectures in PHP
Component and Event-Driven Architectures in PHPComponent and Event-Driven Architectures in PHP
Component and Event-Driven Architectures in PHP
 

More from bryanbibat

Hd 10 japan
Hd 10 japanHd 10 japan
Hd 10 japan
bryanbibat
 
Static Sites in Ruby
Static Sites in RubyStatic Sites in Ruby
Static Sites in Ruby
bryanbibat
 
So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...
bryanbibat
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
bryanbibat
 
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
bryanbibat
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
bryanbibat
 
Rails is Easy*
Rails is Easy*Rails is Easy*
Rails is Easy*
bryanbibat
 
Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)
bryanbibat
 
Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)
bryanbibat
 
From Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to LearningFrom Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to Learning
bryanbibat
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
bryanbibat
 
Preparing for the WebGeek DevCup
Preparing for the WebGeek DevCupPreparing for the WebGeek DevCup
Preparing for the WebGeek DevCup
bryanbibat
 
Productive text editing with Vim
Productive text editing with VimProductive text editing with Vim
Productive text editing with Vim
bryanbibat
 
Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
bryanbibat
 
Latest Trends in Web Technologies
Latest Trends in Web TechnologiesLatest Trends in Web Technologies
Latest Trends in Web Technologies
bryanbibat
 
Virtualization
VirtualizationVirtualization
Virtualization
bryanbibat
 
Some Myths in Software Development
Some Myths in Software DevelopmentSome Myths in Software Development
Some Myths in Software Development
bryanbibat
 
Latest Trends in Open Source Web Technologies
Latest Trends in Open Source Web TechnologiesLatest Trends in Open Source Web Technologies
Latest Trends in Open Source Web Technologies
bryanbibat
 
What it takes to be a Web Developer
What it takes to be a Web DeveloperWhat it takes to be a Web Developer
What it takes to be a Web Developer
bryanbibat
 
Ruby and Rails by example
Ruby and Rails by exampleRuby and Rails by example
Ruby and Rails by example
bryanbibat
 

More from bryanbibat (20)

Hd 10 japan
Hd 10 japanHd 10 japan
Hd 10 japan
 
Static Sites in Ruby
Static Sites in RubyStatic Sites in Ruby
Static Sites in Ruby
 
So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...So You Want to Teach Ruby and Rails...
So You Want to Teach Ruby and Rails...
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
 
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
Upgrading to Ruby 2.1, Rails 4.0, Bootstrap 3.0
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
 
Rails is Easy*
Rails is Easy*Rails is Easy*
Rails is Easy*
 
Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)Things Future IT Students Should Know (But Don't)
Things Future IT Students Should Know (But Don't)
 
Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)Things IT Undergrads Should Know (But Don't)
Things IT Undergrads Should Know (But Don't)
 
From Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to LearningFrom Novice to Expert: A Pragmatic Approach to Learning
From Novice to Expert: A Pragmatic Approach to Learning
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
 
Preparing for the WebGeek DevCup
Preparing for the WebGeek DevCupPreparing for the WebGeek DevCup
Preparing for the WebGeek DevCup
 
Productive text editing with Vim
Productive text editing with VimProductive text editing with Vim
Productive text editing with Vim
 
Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
 
Latest Trends in Web Technologies
Latest Trends in Web TechnologiesLatest Trends in Web Technologies
Latest Trends in Web Technologies
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Some Myths in Software Development
Some Myths in Software DevelopmentSome Myths in Software Development
Some Myths in Software Development
 
Latest Trends in Open Source Web Technologies
Latest Trends in Open Source Web TechnologiesLatest Trends in Open Source Web Technologies
Latest Trends in Open Source Web Technologies
 
What it takes to be a Web Developer
What it takes to be a Web DeveloperWhat it takes to be a Web Developer
What it takes to be a Web Developer
 
Ruby and Rails by example
Ruby and Rails by exampleRuby and Rails by example
Ruby and Rails by example
 

Recently uploaded

The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
Larry Smarr
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 

Recently uploaded (20)

The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 

Haml & Sass presentation

  • 1.  
  • 2. Why code in Ruby / Rails?
  • 3.  
  • 5. + Sign me up!
  • 6. But I like Ruby better.
  • 8. import java.util.Map; import java.util.HashMap; ... Map<Integer, String> hash = new HashMap<Integer, String>(); hash.put(1, &quot;one&quot; ); hash.put(2, &quot;two&quot; ); hash.put(3, &quot;three&quot; );
  • 9. hash = { 1 => &quot; one &quot; , 2 => &quot; two &quot; , 3 => &quot; three &quot; }
  • 10. Rails is (mostly) concise.
  • 11. $ rails blog $ cd blog $ ruby script/generate scaffold entry subject:string content:text $ rake db:migrate $ ruby script/server
  • 12. class Entry < ActiveRecord :: Base end
  • 13. class EntriesController < ApplicationController # GET /entries # GET /entries.xml def index @entries = Entry .all respond_to do | format | format.html # index.html.erb format.xml { render :xml => @entries } end end ...
  • 14. < h1 > Listing entries </ h1 > < table > < tr > < th > Subject </ th > < th > Content </ th > </ tr > <% @entries .each do | entry | %> < tr > < td > <%= h entry.subject %> </ td > < td > <%= h entry.content %> </ td > < td > <%= link_to ' Show ', entry %> </ td > < td > <%= link_to ' Edit ', edit_entry_path(entry) %> </ td > < td > <%= link_to ' Destroy ', entry, :confirm => ' Are you sure? ' , :method => :delete %> </ td > </ tr > <% end %> </ table > < br /> <%= link_to ' New entry ', new_entry_path %>
  • 15. HTML in ERb screws everything up.
  • 16. import java.util.Map; import java.util.HashMap; ... Map<Integer, String> hash = new HashMap<Integer, String>(); hash.put( 1, &quot;one&quot; ); hash.put( 2, &quot;two&quot; ); hash.put( 3, &quot;three&quot; ); Ruby does away with redundant code
  • 17. What if we could do it here too? < h1 > Listing entries </h1> < table > < tr > < th > Subject </th> < th > Content </th> </tr> <% @entries.each do |entry| %> < tr > < td ><% =h entry.subject %></td> < td ><% =h entry.content %></td> < td ><% = link_to 'Show', entry %></td> < td ><% = link_to 'Edit', edit_entry_path(entry) %></td> < td ><% = link_to 'Destroy', entry, :confirm => 'Are you sure?', :method => :delete %></td> </tr> <% end %> </table> < br /> <% = link_to 'New entry', new_entry_path %>
  • 19. % h1 Listing entries Declaring Elements
  • 20. % table % tr % th Subject % th Content Nesting Elements
  • 21. %table %tr %th Subject %th Content - @entries .each do | entry | %tr % td &= entry.subject % td &= entry.content % td = link_to ' Show ' , entry % td = link_to ' Edit ' , edit_entry_path(entry) Ruby Code
  • 22. % p { :style => &quot; color: green &quot; }= notice Attributes
  • 23. % div { :class => &quot; error &quot; , :id => &quot; some_id &quot; } Some Text can be shortened to . class # some_id Some Text divs, classes, and id
  • 24. Why stop at ERb?
  • 25. Sass does with CSS what Haml does with HTML .
  • 26. pre background-color : #eee padding : 10px font-size : 11px No braces! No semicolons!
  • 27. # errorExplanation width: 400px border: 2px solid red padding: 7px padding-bottom: 12px margin-bottom: 20px background-color: #f0f0f0 h2 text-align: left font-weight: bold ... Nested Selectors!
  • 28. $fore: # 333 $bg: # fff body background-color : $bg color : $fore Constants!
  • 29. @mixin rounded($radius: 10px) border-radius: $radius -moz-border-radius: $radius -webkit-border-radius: $radius . fieldWithErrors @include rounded(5px) ... # errorExplanation @include rounded ... Method-like structures!
  • 31. Thank you for listening! my site: http://www.bryanbibat.net