SlideShare une entreprise Scribd logo
Why HAML?




Kirill Zonov (graffzon)
From ERB to Haml (Step 1)
<div class="offering">
  <div class="name">
     <%= offering.name %>
  </div>
  <div class="symbol">
     <%= offering.symbol %>
  </div>
  <div class="last_price">
     <%= number_to_currency offering.last_price %>
  </div>
  <div class="last_traded_at">
     <%= last_trade_at.to_formatted_s(:short) %>
  </div>
  <div class="actions">
     <%= link_to "buy", offering_new_bid_path(offering) %>
     <% if offering.owners.find_by_user_id(session[:uid]) %>
       <%= link_to "sell", offering_new_ask_path(offering) %>
     <% end %>
  </div>
</div>
From ERB to Haml (Step 2)

<div class="offering">
  <div class="name">
     <%= offering.name %>
  <div class="symbol">
     <%= offering.symbol %>
  <div class="last_price">
     <%= number_to_currency offering.last_price %>
  <div class="last_traded_at">
     <%= last_trade_at.to_formatted_s(:short) %>
  <div class="actions">
     <%= link_to "buy", offering_new_bid_path(offering) %>
     <% if offering.owners.find_by_user_id(session[:uid]) %>
       <%= link_to "sell", offering_new_ask_path(offering) %>
From ERB to Haml (Step 3)

.offering
   .name
       = offering.name
    .symbol
       = offering.symbol
    .last_price
       = number_to_currency offering.last_price
    .last_traded_at
       = last_trade_at.to_formatted_s(:short)
    .actions
       = link_to "buy", offering_new_bid_path(offering)
       - if offering.owners.find_by_user_id(session[:uid])
          = link_to "sell", offering_new_ask_path(offering)
Main ideas of Haml

               Markup should:



● be beautiful
● be clean
● be sensible
● follow the rules
Rules of indentations

.some_div
  line one
  line two                <div class='some_div'> line one line two </div> <div
                          class='some_div_two'> line one </div>
.some_div_two             line two
  line one
line two



If we try that:
%h1 test
work?
(<h1> test
         work? </h1> )

Immediately we take error:
Illegal nesting: content can't be both given on the same line as %h1 and nested within it.
Size of code (erb)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>
      <%= configatron.app_name %> - <%= yield(:title) || 'Home' %>
   </title>
   <%= stylesheet_link_tag :flutie, 'application' %>
   <%= javascript_include_tag :defaults, 'rails.validations', 'jquery-snippet' %>
   <%= csrf_meta_tag %>
   <%= yield(:head) %>
   <%= yield :javascript %>
 </head>
<body>
   <div class="content">
   <%= render 'layouts/navigation' %>
   <hr />
   <%= render 'layouts/messages' %>
   <% if show_title? %>
      <h1>
         <%= yield(:title) %>
      </h1>
   <% end %>
   <%= yield %>
   </div>
</body>
</html>
Size of code (haml)


!!!
%html
  %head
  %meta{'http-equiv' => "Content-Type", 'content' => "text/html; charset=utf-8"}
  %title #{configatron.app_name} - #{yield(:title) || 'Home'}
  = stylesheet_link_tag :flutie, 'application'
  = javascript_include_tag :defaults, 'rails.validations', 'jquery-snippet'
  = csrf_meta_tag
  = yield(:head)
  = yield :javascript
%body .content
  = render 'layouts/navigation'
  %hr = render 'layouts/messages'
  %h1=yield(:title)
  if show_title?
    = yield
No need for words ;)
Any problems with haml?




● Perfomance problems
● Need for retraining
Perfomance

   Haml - 0.00033s
   ERB - 0.000222s
   Slim - 0.000254s
   Код:


Haml                                   ERB                                           Slim
%h1 Haml#index %p Find me in           <h1>Erb#index</h1> <p>Find me in              h1 Haml#index p Find me in
app/views/haml/index.html.erb =@haml   app/views/erb/index.html.erb</p> <%= @erb %   app/views/slim/index.html.erb = @slim
                                       >
Intuitive perception

Html with css:
<div class="highlight">
  this is some stuff
</div>
.highlight {
 border: 1px solid #f00 }

Haml with sass:
.highlight
  this is some stuff

.highlight
 border: 1px solid #f00
Now you can see that Haml is
          REALLY better than erb



You also can take a look for my blog graffzon.com

Contenu connexe

Tendances

9. lower in Symfony 4
9. lower in Symfony 49. lower in Symfony 4
9. lower in Symfony 4
Razvan Raducanu, PhD
 
HTML 5 Basics Part One
HTML 5 Basics Part OneHTML 5 Basics Part One
HTML 5 Basics Part One
M Ashraful Islam Jewel
 
Java script
Java scriptJava script
Java script
Sanjay Gunjal
 
Styling with CSS
Styling with CSSStyling with CSS
Styling with CSS
Mike Crabb
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
Anis Ahmad
 
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
 
7. copy2 in Symfony 4
7. copy2 in Symfony 47. copy2 in Symfony 4
7. copy2 in Symfony 4
Razvan Raducanu, PhD
 
JavaScript - Part-1
JavaScript - Part-1JavaScript - Part-1
JavaScript - Part-1
Jainul Musani
 
Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
Yehuda Katz
 
Simple Markdown with Ecto and Protocols
Simple Markdown with Ecto and ProtocolsSimple Markdown with Ecto and Protocols
Simple Markdown with Ecto and Protocols
David Lucia
 
Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)
Thinkful
 
Angular directive filter and routing
Angular directive filter and routingAngular directive filter and routing
Angular directive filter and routing
jagriti srivastava
 
Mechanize at the Ruby Drink-up of Sophia, November 2011
Mechanize at the Ruby Drink-up of Sophia, November 2011Mechanize at the Ruby Drink-up of Sophia, November 2011
Mechanize at the Ruby Drink-up of Sophia, November 2011
rivierarb
 
Upstate CSCI 450 WebDev Chapter 2
Upstate CSCI 450 WebDev Chapter 2Upstate CSCI 450 WebDev Chapter 2
Upstate CSCI 450 WebDev Chapter 2
DanWooster1
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
Sean Cribbs
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
borkweb
 
Coder Presentation
Coder  PresentationCoder  Presentation
Coder Presentation
Doug Green
 
JavaScript Introduction
JavaScript IntroductionJavaScript Introduction
JavaScript Introduction
Jainul Musani
 
URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5
jakemallory
 

Tendances (19)

9. lower in Symfony 4
9. lower in Symfony 49. lower in Symfony 4
9. lower in Symfony 4
 
HTML 5 Basics Part One
HTML 5 Basics Part OneHTML 5 Basics Part One
HTML 5 Basics Part One
 
Java script
Java scriptJava script
Java script
 
Styling with CSS
Styling with CSSStyling with CSS
Styling with CSS
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
7. copy2 in Symfony 4
7. copy2 in Symfony 47. copy2 in Symfony 4
7. copy2 in Symfony 4
 
JavaScript - Part-1
JavaScript - Part-1JavaScript - Part-1
JavaScript - Part-1
 
Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
 
Simple Markdown with Ecto and Protocols
Simple Markdown with Ecto and ProtocolsSimple Markdown with Ecto and Protocols
Simple Markdown with Ecto and Protocols
 
Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)Build a game with javascript (may 21 atlanta)
Build a game with javascript (may 21 atlanta)
 
Angular directive filter and routing
Angular directive filter and routingAngular directive filter and routing
Angular directive filter and routing
 
Mechanize at the Ruby Drink-up of Sophia, November 2011
Mechanize at the Ruby Drink-up of Sophia, November 2011Mechanize at the Ruby Drink-up of Sophia, November 2011
Mechanize at the Ruby Drink-up of Sophia, November 2011
 
Upstate CSCI 450 WebDev Chapter 2
Upstate CSCI 450 WebDev Chapter 2Upstate CSCI 450 WebDev Chapter 2
Upstate CSCI 450 WebDev Chapter 2
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
 
Coder Presentation
Coder  PresentationCoder  Presentation
Coder Presentation
 
JavaScript Introduction
JavaScript IntroductionJavaScript Introduction
JavaScript Introduction
 
URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5URUG Ruby on Rails Workshop - Sesssion 5
URUG Ruby on Rails Workshop - Sesssion 5
 

En vedette

Facebook for public health - NPIN
Facebook for public health - NPINFacebook for public health - NPIN
Facebook for public health - NPINGiuseppe Fattori
 
2.tao of topic maps
2.tao of topic maps2.tao of topic maps
2.tao of topic maps
Gabriel Hopmans
 
3.typing and advanced constructs
3.typing and advanced constructs3.typing and advanced constructs
3.typing and advanced constructs
Gabriel Hopmans
 
Columbia Corporate Strategy Retreat 03.14.12
Columbia Corporate Strategy Retreat 03.14.12Columbia Corporate Strategy Retreat 03.14.12
Columbia Corporate Strategy Retreat 03.14.12
Mightybytes
 
As media course work- evaluation
As media course work- evaluationAs media course work- evaluation
As media course work- evaluation
Billysmedia
 
Saa s案例分析01
Saa s案例分析01Saa s案例分析01
Saa s案例分析01
shaoshao11
 
Arthur conan doyle2
Arthur conan doyle2Arthur conan doyle2
Arthur conan doyle2
ian11644
 
Distribution of Silicon iin the Allumiinum Matriix for Rear Passiivated Solla...
Distribution of Silicon iin the Allumiinum Matriix for Rear Passiivated Solla...Distribution of Silicon iin the Allumiinum Matriix for Rear Passiivated Solla...
Distribution of Silicon iin the Allumiinum Matriix for Rear Passiivated Solla...
Elías Urrejola
 
As media course work- evaluation
As media course work- evaluationAs media course work- evaluation
As media course work- evaluation
Billysmedia
 
20121204 are your lights on?
20121204 are your lights on?20121204 are your lights on?
20121204 are your lights on?jasonmel
 
Arthur conan doyle2
Arthur conan doyle2Arthur conan doyle2
Arthur conan doyle2
ian11644
 
Ec tech heritage buildings 11_mn01
Ec tech heritage buildings 11_mn01Ec tech heritage buildings 11_mn01
Ec tech heritage buildings 11_mn01
Frost & Sullivan
 
Ragged school
Ragged schoolRagged school
Ragged school
michaelao5
 
Backup and Security Lite WCPHX13
Backup and Security Lite WCPHX13Backup and Security Lite WCPHX13
Backup and Security Lite WCPHX13
Jeffrey Zinn
 
Body parts
Body partsBody parts
Body parts
julested2
 
Pertemuan 8
Pertemuan 8Pertemuan 8
Pertemuan 8
mutmainnamaruru
 

En vedette (20)

Facebook for public health - NPIN
Facebook for public health - NPINFacebook for public health - NPIN
Facebook for public health - NPIN
 
2.tao of topic maps
2.tao of topic maps2.tao of topic maps
2.tao of topic maps
 
3.typing and advanced constructs
3.typing and advanced constructs3.typing and advanced constructs
3.typing and advanced constructs
 
Eurovegas
EurovegasEurovegas
Eurovegas
 
MAN2012
MAN2012MAN2012
MAN2012
 
Columbia Corporate Strategy Retreat 03.14.12
Columbia Corporate Strategy Retreat 03.14.12Columbia Corporate Strategy Retreat 03.14.12
Columbia Corporate Strategy Retreat 03.14.12
 
As media course work- evaluation
As media course work- evaluationAs media course work- evaluation
As media course work- evaluation
 
Saa s案例分析01
Saa s案例分析01Saa s案例分析01
Saa s案例分析01
 
Arthur conan doyle2
Arthur conan doyle2Arthur conan doyle2
Arthur conan doyle2
 
Pertemuan 7
Pertemuan 7Pertemuan 7
Pertemuan 7
 
Distribution of Silicon iin the Allumiinum Matriix for Rear Passiivated Solla...
Distribution of Silicon iin the Allumiinum Matriix for Rear Passiivated Solla...Distribution of Silicon iin the Allumiinum Matriix for Rear Passiivated Solla...
Distribution of Silicon iin the Allumiinum Matriix for Rear Passiivated Solla...
 
As media course work- evaluation
As media course work- evaluationAs media course work- evaluation
As media course work- evaluation
 
6. analisis jaringan
6. analisis jaringan6. analisis jaringan
6. analisis jaringan
 
20121204 are your lights on?
20121204 are your lights on?20121204 are your lights on?
20121204 are your lights on?
 
Arthur conan doyle2
Arthur conan doyle2Arthur conan doyle2
Arthur conan doyle2
 
Ec tech heritage buildings 11_mn01
Ec tech heritage buildings 11_mn01Ec tech heritage buildings 11_mn01
Ec tech heritage buildings 11_mn01
 
Ragged school
Ragged schoolRagged school
Ragged school
 
Backup and Security Lite WCPHX13
Backup and Security Lite WCPHX13Backup and Security Lite WCPHX13
Backup and Security Lite WCPHX13
 
Body parts
Body partsBody parts
Body parts
 
Pertemuan 8
Pertemuan 8Pertemuan 8
Pertemuan 8
 

Similaire à Haml. New HTML? (RU)

AEM Sightly Template Language
AEM Sightly Template LanguageAEM Sightly Template Language
AEM Sightly Template Language
Gabriel Walt
 
The Rails Way
The Rails WayThe Rails Way
The Rails Way
Michał Orman
 
Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101
Ted Kulp
 
Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2
RORLAB
 
Clean separation
Clean separationClean separation
Clean separation
atorreno
 
Html, CSS, Javascript, Jquery, Meteor應用
Html, CSS, Javascript, Jquery, Meteor應用Html, CSS, Javascript, Jquery, Meteor應用
Html, CSS, Javascript, Jquery, Meteor應用
LearningTech
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails Turtorial
Yi-Ting Cheng
 
RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2
Rory Gianni
 
Documenting from the Trenches
Documenting from the TrenchesDocumenting from the Trenches
Documenting from the Trenches
Xavier Noria
 
SEO for Developers
SEO for DevelopersSEO for Developers
SEO for Developers
Christopher Le
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
Knoldus Inc.
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-public
Chul Ju Hong
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatterns
Chul Ju Hong
 
Rails for Beginners - Le Wagon
Rails for Beginners - Le WagonRails for Beginners - Le Wagon
Rails for Beginners - Le Wagon
Alex Benoit
 
Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
Kyle Cearley
 
Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11
Pedro Cunha
 
Php
PhpPhp
Angular.js Fundamentals
Angular.js FundamentalsAngular.js Fundamentals
Angular.js Fundamentals
Mark
 
AngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.jsAngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.js
Mark
 
Intro to Haml
Intro to HamlIntro to Haml
Intro to Haml
Clifford Heath
 

Similaire à Haml. New HTML? (RU) (20)

AEM Sightly Template Language
AEM Sightly Template LanguageAEM Sightly Template Language
AEM Sightly Template Language
 
The Rails Way
The Rails WayThe Rails Way
The Rails Way
 
Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101
 
Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2
 
Clean separation
Clean separationClean separation
Clean separation
 
Html, CSS, Javascript, Jquery, Meteor應用
Html, CSS, Javascript, Jquery, Meteor應用Html, CSS, Javascript, Jquery, Meteor應用
Html, CSS, Javascript, Jquery, Meteor應用
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails Turtorial
 
RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2
 
Documenting from the Trenches
Documenting from the TrenchesDocumenting from the Trenches
Documenting from the Trenches
 
SEO for Developers
SEO for DevelopersSEO for Developers
SEO for Developers
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-public
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatterns
 
Rails for Beginners - Le Wagon
Rails for Beginners - Le WagonRails for Beginners - Le Wagon
Rails for Beginners - Le Wagon
 
Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
 
Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11
 
Php
PhpPhp
Php
 
Angular.js Fundamentals
Angular.js FundamentalsAngular.js Fundamentals
Angular.js Fundamentals
 
AngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.jsAngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.js
 
Intro to Haml
Intro to HamlIntro to Haml
Intro to Haml
 

Plus de Kirill Zonov

AWS X-Ray introduction and my experience
AWS X-Ray introduction and my experienceAWS X-Ray introduction and my experience
AWS X-Ray introduction and my experience
Kirill Zonov
 
Kubernetes and Helm 101
Kubernetes and Helm 101Kubernetes and Helm 101
Kubernetes and Helm 101
Kirill Zonov
 
IBM Watson as tutor, not a voice interface
IBM Watson as tutor, not a voice interfaceIBM Watson as tutor, not a voice interface
IBM Watson as tutor, not a voice interface
Kirill Zonov
 
DevOpsDays Berlin 2018 Terraform hands-on workshop
DevOpsDays Berlin 2018 Terraform hands-on workshopDevOpsDays Berlin 2018 Terraform hands-on workshop
DevOpsDays Berlin 2018 Terraform hands-on workshop
Kirill Zonov
 
Go for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B MeetupGo for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B Meetup
Kirill Zonov
 
Ruby on Grapes. Why did we choose Grape and why I would choose it again
Ruby on Grapes. Why did we choose Grape and why I would choose it againRuby on Grapes. Why did we choose Grape and why I would choose it again
Ruby on Grapes. Why did we choose Grape and why I would choose it again
Kirill Zonov
 
Haskell. Getting started (RU)
Haskell. Getting started (RU)Haskell. Getting started (RU)
Haskell. Getting started (RU)
Kirill Zonov
 

Plus de Kirill Zonov (7)

AWS X-Ray introduction and my experience
AWS X-Ray introduction and my experienceAWS X-Ray introduction and my experience
AWS X-Ray introduction and my experience
 
Kubernetes and Helm 101
Kubernetes and Helm 101Kubernetes and Helm 101
Kubernetes and Helm 101
 
IBM Watson as tutor, not a voice interface
IBM Watson as tutor, not a voice interfaceIBM Watson as tutor, not a voice interface
IBM Watson as tutor, not a voice interface
 
DevOpsDays Berlin 2018 Terraform hands-on workshop
DevOpsDays Berlin 2018 Terraform hands-on workshopDevOpsDays Berlin 2018 Terraform hands-on workshop
DevOpsDays Berlin 2018 Terraform hands-on workshop
 
Go for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B MeetupGo for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B Meetup
 
Ruby on Grapes. Why did we choose Grape and why I would choose it again
Ruby on Grapes. Why did we choose Grape and why I would choose it againRuby on Grapes. Why did we choose Grape and why I would choose it again
Ruby on Grapes. Why did we choose Grape and why I would choose it again
 
Haskell. Getting started (RU)
Haskell. Getting started (RU)Haskell. Getting started (RU)
Haskell. Getting started (RU)
 

Dernier

Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 

Dernier (20)

Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 

Haml. New HTML? (RU)

  • 2. From ERB to Haml (Step 1) <div class="offering"> <div class="name"> <%= offering.name %> </div> <div class="symbol"> <%= offering.symbol %> </div> <div class="last_price"> <%= number_to_currency offering.last_price %> </div> <div class="last_traded_at"> <%= last_trade_at.to_formatted_s(:short) %> </div> <div class="actions"> <%= link_to "buy", offering_new_bid_path(offering) %> <% if offering.owners.find_by_user_id(session[:uid]) %> <%= link_to "sell", offering_new_ask_path(offering) %> <% end %> </div> </div>
  • 3. From ERB to Haml (Step 2) <div class="offering"> <div class="name"> <%= offering.name %> <div class="symbol"> <%= offering.symbol %> <div class="last_price"> <%= number_to_currency offering.last_price %> <div class="last_traded_at"> <%= last_trade_at.to_formatted_s(:short) %> <div class="actions"> <%= link_to "buy", offering_new_bid_path(offering) %> <% if offering.owners.find_by_user_id(session[:uid]) %> <%= link_to "sell", offering_new_ask_path(offering) %>
  • 4. From ERB to Haml (Step 3) .offering .name = offering.name .symbol = offering.symbol .last_price = number_to_currency offering.last_price .last_traded_at = last_trade_at.to_formatted_s(:short) .actions = link_to "buy", offering_new_bid_path(offering) - if offering.owners.find_by_user_id(session[:uid]) = link_to "sell", offering_new_ask_path(offering)
  • 5. Main ideas of Haml Markup should: ● be beautiful ● be clean ● be sensible ● follow the rules
  • 6. Rules of indentations .some_div line one line two <div class='some_div'> line one line two </div> <div class='some_div_two'> line one </div> .some_div_two line two line one line two If we try that: %h1 test work? (<h1> test work? </h1> ) Immediately we take error: Illegal nesting: content can't be both given on the same line as %h1 and nested within it.
  • 7. Size of code (erb) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> <%= configatron.app_name %> - <%= yield(:title) || 'Home' %> </title> <%= stylesheet_link_tag :flutie, 'application' %> <%= javascript_include_tag :defaults, 'rails.validations', 'jquery-snippet' %> <%= csrf_meta_tag %> <%= yield(:head) %> <%= yield :javascript %> </head> <body> <div class="content"> <%= render 'layouts/navigation' %> <hr /> <%= render 'layouts/messages' %> <% if show_title? %> <h1> <%= yield(:title) %> </h1> <% end %> <%= yield %> </div> </body> </html>
  • 8. Size of code (haml) !!! %html %head %meta{'http-equiv' => "Content-Type", 'content' => "text/html; charset=utf-8"} %title #{configatron.app_name} - #{yield(:title) || 'Home'} = stylesheet_link_tag :flutie, 'application' = javascript_include_tag :defaults, 'rails.validations', 'jquery-snippet' = csrf_meta_tag = yield(:head) = yield :javascript %body .content = render 'layouts/navigation' %hr = render 'layouts/messages' %h1=yield(:title) if show_title? = yield
  • 9. No need for words ;)
  • 10. Any problems with haml? ● Perfomance problems ● Need for retraining
  • 11. Perfomance Haml - 0.00033s ERB - 0.000222s Slim - 0.000254s Код: Haml ERB Slim %h1 Haml#index %p Find me in <h1>Erb#index</h1> <p>Find me in h1 Haml#index p Find me in app/views/haml/index.html.erb =@haml app/views/erb/index.html.erb</p> <%= @erb % app/views/slim/index.html.erb = @slim >
  • 12. Intuitive perception Html with css: <div class="highlight"> this is some stuff </div> .highlight { border: 1px solid #f00 } Haml with sass: .highlight this is some stuff .highlight border: 1px solid #f00
  • 13. Now you can see that Haml is REALLY better than erb You also can take a look for my blog graffzon.com