SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
HOW TOMAKEYOURDAILYWORKAPIECEOFCAKE
FRONTENDDEVTOOLS
.mat.czajka@gmail.com /czajkovsky
MateuszCzajkafromNetguru
Intro
Intro
Intro
<section id="users">
<div class="user" data-user-id="45">
<strong class="user__nickname">
czajkovsky
</strong>
Some info about this user.
</</div>
</section>
HTML
HTMLVSHAML&SLIM
<section id="users">
<div class="user" data-user-id="45">
<strong class="user__nickname">
czajkovsky
</strong>
Some info about this user.
</</div>
</section>
HTML
HAML %section#users
.user{ data: { user_id: 45 } }
%strong.user__nickname czajkovsky
Some info about this user.
HTMLVSHAML&SLIM
<section id="users">
<div class="user" data-user-id="45">
<strong class="user__nickname">
czajkovsky
</strong>
Some info about this user.
</</div>
</section>
HTML
SLIM section#users
.user data-user-id=45
strong.user__nickname czajkovsky
| Some info about this user.
HAML %section#users
.user{ data: { user_id: 45 } }
%strong.user__nickname czajkovsky
Some info about this user.
HTMLVSHAML&SLIM
<section id="users">
<div class="user" data-user-id="45">
<strong class="user__nickname">
czajkovsky
</strong>
Some info about this user.
</</div>
</section>
HTML
SLIM section#users
.user data-user-id=45
strong.user__nickname czajkovsky
| Some info about this user.
HAML %section#users
.user{ data: { user_id: 45 } }
%strong.user__nickname czajkovsky
Some info about this user.
enforcesondevelopercorrect
indent
youdon’thavetorememberabout
closingtags
codeismuchshorter
PROS
HTMLVSHAML&SLIM
<section id="users">
<div class="user" data-user-id="45">
<strong class="user__nickname">
czajkovsky
</strong>
Some info about this user.
</</div>
</section>
HTML
SLIM section#users
.user data-user-id=45
strong.user__nickname czajkovsky
| Some info about this user.
HAML %section#users
.user{ data: { user_id: 45 } }
%strong.user__nickname czajkovsky
Some info about this user.
enforcesondevelopercorrect
indent
youdon’thavetorememberabout
closingtags
codeismuchshorter
PROS
newdevelopermustbefamiliarwithit
(learningtakes20minutes)
CONS?
HTMLVSHAML&SLIM
<section id="users">
<div class="user" data-user-id="45">
<strong class="user__nickname">
czajkovsky
</strong>
Some info about this user.
</</div>
</section>
HTML
SLIM section#users
.user data-user-id=45
strong.user__nickname czajkovsky
| Some info about this user.
HAML %section#users
.user{ data: { user_id: 45 } }
%strong.user__nickname czajkovsky
Some info about this user.
enforcesondevelopercorrect
indent
youdon’thavetorememberabout
closingtags
codeismuchshorter
PROS
newdevelopermustbefamiliarwithit
(learningtakes20minutes)
CONS?
Slim isfaster
Slim allowsyoutodefinecustom
shortcuts
HAMLismorepopular
HAMLVSSLIM
HTMLVSHAML&SLIM
.users {
background: #fff;
}
.users h3 {
color: #000;
}
CSS
CSSvsSass(SCSS)
.users {
background: #fff;
}
.users h3 {
color: #000;
}
CSS
SCSS .users {
background: #fff;
h3 {
color: #000;
}
}
CSSvsSass(SCSS)
.users {
background: #fff;
}
.users h3 {
color: #000;
}
CSS
Sass .users
background: #fff;
h3
color: #000;
SCSS .users {
background: #fff;
h3 {
color: #000;
}
}
CSSvsSass(SCSS)
.users {
background: #fff;
}
.users h3 {
color: #000;
}
CSS
Sass .users
background: #fff;
h3
color: #000;
SCSS .users {
background: #fff;
h3 {
color: #000;
}
}
codeismoreDRY,muchshorterandeasier
tomaintain
Pros
CSSvsSass(SCSS)
.users {
background: #fff;
}
.users h3 {
color: #000;
}
CSS
Sass .users
background: #fff;
h3
color: #000;
SCSS .users {
background: #fff;
h3 {
color: #000;
}
}
codeismoreDRY,muchshorterandeasier
tomaintain
Pros
nocons:)
Cons
CSSvsSass(SCSS)
.users {
background: #fff;
}
.users h3 {
color: #000;
}
CSS
Sass .users
background: #fff;
h3
color: #000;
SCSS .users {
background: #fff;
h3 {
color: #000;
}
}
codeismoreDRY,muchshorterandeasier
tomaintain
Pros
nocons:)
Cons
Sasshasmoreconcisesyntax
(doesn’trequirecurlybrackets,semicolons)
SCSSiscompatiblewithCSS
SassvsSCSS
CSSvsSass(SCSS)
Variables
$width: 1rem;
.foo {
width: $width;
height: $width;
}
SCSS .foo {
width: 1rem;
height: 1rem;
}
CSS
Sassvariables&referencesymbol
Variables
$width: 1rem;
.foo {
width: $width;
height: $width;
}
SCSS .foo {
width: 1rem;
height: 1rem;
}
CSS
Referencesymbol
.foo {
color: #f00;
&.bar {
height: #000;
}
}
SCSS .foo {
color: #f00;
}
.foo.bar {
color: #000;
}
CSS
Sassvariables&referencesymbol
Variables
$width: 1rem;
.foo {
width: $width;
height: $width;
}
SCSS .foo {
width: 1rem;
height: 1rem;
}
CSS
Referencesymbol
.foo {
color: #f00;
&.bar {
height: #000;
}
}
SCSS .foo {
color: #f00;
}
.foo.bar {
color: #000;
}
CSS
.foo {
color: #f00;
.ie7 & {
height: #000;
}
}
SCSS .foo {
color: #f00;
}
.ie7 .foo {
color: #000;
}
CSS
Sassvariables&referencesymbol
Referencesymbol-BEM syntax(Sass3.3)
.user {
&__nickname {
color: #f00;
}
&--unverified {
background: #00f;
}}
}
SCSS .user__nickname {
color: #f00;
}
.user--unverified {
background: #00f;
}
CSS
SassBEMsyntax
Referencesymbol-BEM syntax(Sass3.3)
.user {
&__nickname {
color: #f00;
}
&--unverified {
background: #00f;
}}
}
SCSS .user__nickname {
color: #f00;
}
.user--unverified {
background: #00f;
}
CSS
CSSreflectsHTMLstructure
easiertoread
Pros
HTMLclassesnamescanbelong
Cons
SassBEMsyntax
Mixins
@mixin square($size) {
width: $size;
height: $size;
}
.post {
@include square(1rem);
}}
SCSS .post {
width: 1rem;
height: 1rem;
}
CSS
Sassmixins&functions
Mixins
@mixin square($size) {
width: $size;
height: $size;
}
.post {
@include square(1rem);
}}
SCSS .post {
width: 1rem;
height: 1rem;
}
CSS
Functions
@function double($value) {
@return $value * 2;
}
.post {
width: double(14px);
}
SCSS .post {
width: 28px;
}
CSS
Sassmixins&functions
@extendthebadway
.button {
border-color: #f00;
}
.button--big {
@extend .button;
background: #00f;
}}
SCSS .button, .button--big {
border-color: #f00;
}
.button--big {
background: #00f;
}
CSS
Sass@extend,placeholders
@extendthebadway
.button {
border-color: #f00;
}
.button--big {
@extend .button;
background: #00f;
}}
SCSS .button, .button--big {
border-color: #f00;
}
.button--big {
background: #00f;
}
CSS
Placeholders
%button {
border-color: #f00;
}
.button--big {
@extend %button;
background: #00f;
}}
SCSS .button--big {
border-color: #f00;
}
.button--big {
background: #00f;
}
CSS
Sass@extend,placeholders
If
.post {
@if ($dark == true) {
color: #000;
} @else {
color: #fff;
}
}}
.post {
color: if($dark == true, #000, #fff);
}
Sassifs,loops&maps
For
@for $i from 3 through 1 {
h#{4 - $i} {
font-size: 2rem * $i;
}
}
If
.post {
@if ($dark == true) {
color: #000;
} @else {
color: #fff;
}
}}
.post {
color: if($dark == true, #000, #fff);
}
Sassifs,loops&maps
Each
$alerts: (error, red, 1px),
(success, green, 2px),
(info, blue, 2px);
@each $type, $color, $border in $alerts {
.alert--#{$type} {
border: $border solid $color;
}}
}
For
@for $i from 3 through 1 {
h#{4 - $i} {
font-size: 2rem * $i;
}
}
If
.post {
@if ($dark == true) {
color: #000;
} @else {
color: #fff;
}
}}
.post {
color: if($dark == true, #000, #fff);
}
Sassifs,loops&maps
Each
$alerts: (error, red, 1px),
(success, green, 2px),
(info, blue, 2px);
@each $type, $color, $border in $alerts {
.alert--#{$type} {
border: $border solid $color;
}}
}
Maps
$indexes: (
menu: 999,
badge: 1050
);
.foo {
z-index: map-get($indexes, menu);
}}
For
@for $i from 3 through 1 {
h#{4 - $i} {
font-size: 2rem * $i;
}
}
If
.post {
@if ($dark == true) {
color: #000;
} @else {
color: #fff;
}
}}
.post {
color: if($dark == true, #000, #fff);
}
Sassifs,loops&maps
@contentdirective
@mixin media($device, $only: false) {
...
@media screen and (min-width: $min-width) {
@content;
}
...
}}
// full mixin https://netguru.co/blog/categories/css
.foo {
@include media(tablet, true) {
background: #f00;
}
}
SCSS
Sass@contentdirective
@contentdirective
@mixin media($device, $only: false) {
...
@media screen and (min-width: $min-width) {
@content;
}
...
}}
// full mixin https://netguru.co/blog/categories/css
.foo {
@include media(tablet, true) {
background: #f00;
}
}
SCSS
@media screen and (min-width: 48rem) and (max-width: 62rem) {
.foo {
background: #f00;
}
}
CSS
Sass@contentdirective
class Lecture
constructor: (@title, @author) ->
@slides = []
display_date: ->
if @date? then @date else "Sorry, no info about date for #{@title}"
add_slide: (name, duration) ->
slide =
name: name
duration: duration
@slides.push slide
long_slides: ->
s.name for s in @slides when s.duration > 3
CoffeeScript
class Lecture
constructor: (@title, @author) ->
@slides = []
display_date: ->
if @date? then @date else "Sorry, no info about date for #{@title}"
add_slide: (name, duration) ->
slide =
name: name
duration: duration
@slides.push slide
long_slides: ->
s.name for s in @slides when s.duration > 3
CoffeeScript
codeisshorterby1/3withoutany
incluenceonexecutiontime
(iscompiledtoJS)
syntax(defaultinRoRfromversion3.1)
Pros
class Lecture
constructor: (@title, @author) ->
@slides = []
display_date: ->
if @date? then @date else "Sorry, no info about date for #{@title}"
add_slide: (name, duration) ->
slide =
name: name
duration: duration
@slides.push slide
long_slides: ->
s.name for s in @slides when s.duration > 3
CoffeeScript
codeisshorterby1/3withoutany
incluenceonexecutiontime
(iscompiledtoJS)
syntax(defaultinRoRfromversion3.1)
Pros
syntax
Cons
CoffeeScript
@id # this.id
class Lecture
@findByTitle: (title) ->
...
@Alias
CoffeeScript
'foo exists' if foo?
# typeof foo !== "undefined" &&
# foo !== null
foo?.prop?.subprop?
foo.prop ?= 'new val'
Existentialoperator
@id # this.id
class Lecture
@findByTitle: (title) ->
...
@Alias
CoffeeScript
'foo exists' if foo?
# typeof foo !== "undefined" &&
# foo !== null
foo?.prop?.subprop?
foo.prop ?= 'new val'
Existentialoperator
@id # this.id
class Lecture
@findByTitle: (title) ->
...
@Alias
# foo = { bar: 1, baz: 2 }
foo =
bar: 1
baz: 2
# range = [2, 3, 4, 5]
range = [2..5]
Objects,arrays
CoffeeScript
'foo exists' if foo?
# typeof foo !== "undefined" &&
# foo !== null
foo?.prop?.subprop?
foo.prop ?= 'new val'
Existentialoperator
@id # this.id
class Lecture
@findByTitle: (title) ->
...
@Alias
# foo = { bar: 1, baz: 2 }
foo =
bar: 1
baz: 2
# range = [2, 3, 4, 5]
range = [2..5]
Objects,arrays
for name, i in ['HAML', 'CSS', 'JS']
alert "#{i}: #{name}"
# a = [{ name: 'HAML', duration: 5 }, ...]
s.name for s in a when s.duration > 3
Loops&comprehensions
CoffeeScript
foo = (bar) ->
# your function body
square = (x) -> x * x
power = (a = 1, b = 2) ->
Math.pow(a, b)
Functions
CoffeeScript
foo = (bar) ->
# your function body
square = (x) -> x * x
power = (a = 1, b = 2) ->
Math.pow(a, b)
Functions
foo: ->
# your function body
"this will be returned"
Autoreturn
CoffeeScript
foo = (bar) ->
# your function body
square = (x) -> x * x
power = (a = 1, b = 2) ->
Math.pow(a, b)
Functions
'boring...' if sleeping_folks > 2
unless foo is 1
if bar isnt 2 and baz is 7
'mid-length' if 3 < l.duration < 5
Flowcontrol
foo: ->
# your function body
"this will be returned"
Autoreturn
CoffeeScript
foo = (bar) ->
# your function body
square = (x) -> x * x
power = (a = 1, b = 2) ->
Math.pow(a, b)
Functions
'boring...' if sleeping_folks > 2
unless foo is 1
if bar isnt 2 and baz is 7
'mid-length' if 3 < l.duration < 5
Flowcontrol
foo: ->
# your function body
"this will be returned"
Autoreturn
"#{title} by #{author}" # OK
'#{title} by #{author}' # won't work
Interpolation
CoffeeScript
class Lecture
prepare: (@subject) ->
notify: ->
alert @subject()
class Speaker
constructor: (@name) ->
@lecture = new Lecture
@lecture.prepare () => "New lecture by #{@name}"
p = new Speaker('czajkovsky')
p.lecture.notify()
Fatarrow
CoffeeScript
class Lecture
prepare: (@subject) ->
notify: ->
alert @subject()
class Speaker
constructor: (@name) ->
@lecture = new Lecture
@lecture.prepare () => "New lecture by #{@name}"
p = new Speaker('czajkovsky')
p.lecture.notify()
Fatarrow
[month, day, year] = 'June 2 14'.split ' '
Multipleassignment
class Lecture
constructor: (@title, @author) ->
@slides = []
display_date: ->
if @date? then @date else "Sorry, no info about date for #{@title}"
long_slides: ->
s.name for s in @slides when s.duration > 3
add_slide: (name, duration) ->
slide =
name: name
duration: duration
@slides.@slides.push slide
CoffeeScript
class Lecture
constructor: (@title, @author) ->
@slides = []
display_date: ->
if @date? then @date else "Sorry, no info about date for #{@title}"
long_slides: ->
s.name for s in @slides when s.duration > 3
add_slide: (name, duration) ->
slide =
name: name
duration: duration
@slides.@slides.push slide
l = new Lecture('Front-end tools', 'czajkovsky')
l.display_date()
# Sorry, no info about date for Front-end tools
CoffeeScript
class Lecture
constructor: (@title, @author) ->
@slides = []
display_date: ->
if @date? then @date else "Sorry, no info about date for #{@title}"
long_slides: ->
s.name for s in @slides when s.duration > 3
add_slide: (name, duration) ->
slide =
name: name
duration: duration
@slides.@slides.push slide
l = new Lecture('Front-end tools', 'czajkovsky')
l.display_date()
# Sorry, no info about date for Front-end tools
l.date = '02/06/2014 18:30'
l.display_date()
# 02/06/2014 18:30
CoffeeScript
class Lecture
constructor: (@title, @author) ->
@slides = []
display_date: ->
if @date? then @date else "Sorry, no info about date for #{@title}"
long_slides: ->
s.name for s in @slides when s.duration > 3
add_slide: (name, duration) ->
slide =
name: name
duration: duration
@slides.@slides.push slide
l = new Lecture('Front-end tools', 'czajkovsky')
l.display_date()
# Sorry, no info about date for Front-end tools
l.date = '02/06/2014 18:30'
l.display_date()
# 02/06/2014 18:30
l.add_slide(l.add_slide('HAML', 2)
l.add_slide('Sass', 5)
l.add_slide('CoffeeScript', 4)
l.long_slides()
# ["Sass", "CoffeeScript"]
CoffeeScript
netguru.co/career
Thankyou!
sassmeister.com
thesassway.com
html2slim.herokuapp.com
html2haml.heroku.com js2coffee.org

Contenu connexe

Tendances

CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
拓樹 谷
 
Just css results dogmeat template validator
Just css results dogmeat template validatorJust css results dogmeat template validator
Just css results dogmeat template validator
Gaejang Guk
 
The project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicerThe project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicer
Andrei Hortúa
 

Tendances (20)

Finding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with CompassFinding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with Compass
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
 
Componentization css angular
Componentization css angularComponentization css angular
Componentization css angular
 
Getting to Know Bootstrap for Rapid Web Development
Getting to Know Bootstrap for Rapid Web DevelopmentGetting to Know Bootstrap for Rapid Web Development
Getting to Know Bootstrap for Rapid Web Development
 
Insertcustomer
InsertcustomerInsertcustomer
Insertcustomer
 
20160908 Aesthetic-Driven Development
20160908 Aesthetic-Driven Development20160908 Aesthetic-Driven Development
20160908 Aesthetic-Driven Development
 
Emmet cheat-sheet
Emmet cheat-sheetEmmet cheat-sheet
Emmet cheat-sheet
 
This is a test
This is a testThis is a test
This is a test
 
Just css results dogmeat template validator
Just css results dogmeat template validatorJust css results dogmeat template validator
Just css results dogmeat template validator
 
Html code
Html codeHtml code
Html code
 
How to Think Inside the Box: Programming Fixed Layout for E-Books
How to Think Inside the Box: Programming Fixed Layout for E-BooksHow to Think Inside the Box: Programming Fixed Layout for E-Books
How to Think Inside the Box: Programming Fixed Layout for E-Books
 
Landing Pages 101
Landing Pages 101Landing Pages 101
Landing Pages 101
 
Xlrays online web tutorials
Xlrays online web tutorialsXlrays online web tutorials
Xlrays online web tutorials
 
Presentation 2
Presentation 2Presentation 2
Presentation 2
 
The project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicerThe project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicer
 
Html Tags
Html TagsHtml Tags
Html Tags
 
Se meu elefante falasse
Se meu elefante falasseSe meu elefante falasse
Se meu elefante falasse
 
HTML5 - Pedro Rosa
HTML5 - Pedro RosaHTML5 - Pedro Rosa
HTML5 - Pedro Rosa
 
Test upload
Test uploadTest upload
Test upload
 
The Thinking behind BEM
The Thinking behind BEMThe Thinking behind BEM
The Thinking behind BEM
 

Similaire à Front-End Dev Tools

Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
Zeeshan Ahmed
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
Itai Koren
 
Auto tools
Auto toolsAuto tools
Auto tools
祺 周
 
Evrone.ru / BEM for RoR
Evrone.ru / BEM for RoREvrone.ru / BEM for RoR
Evrone.ru / BEM for RoR
Dmitry KODer
 

Similaire à Front-End Dev Tools (20)

Refresh Tallahassee: The RE/MAX Front End Story
Refresh Tallahassee: The RE/MAX Front End StoryRefresh Tallahassee: The RE/MAX Front End Story
Refresh Tallahassee: The RE/MAX Front End Story
 
CSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendCSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the Backend
 
Breakpoint
BreakpointBreakpoint
Breakpoint
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Sakai Meet MORPHEUS: Slides
Sakai Meet MORPHEUS: SlidesSakai Meet MORPHEUS: Slides
Sakai Meet MORPHEUS: Slides
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the World
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
CSS3
CSS3CSS3
CSS3
 
The things browsers can do! SAE Alumni Convention 2014
The things browsers can do! SAE Alumni Convention 2014The things browsers can do! SAE Alumni Convention 2014
The things browsers can do! SAE Alumni Convention 2014
 
Auto tools
Auto toolsAuto tools
Auto tools
 
Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018
Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018
Joan Leon | Houdini, programando en CSS | Codemotion Madrid 2018
 
PostCss
PostCssPostCss
PostCss
 
Css3
Css3Css3
Css3
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Evrone.ru / BEM for RoR
Evrone.ru / BEM for RoREvrone.ru / BEM for RoR
Evrone.ru / BEM for RoR
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 

Plus de Netguru

Paradygmaty Programowania: Czy Istnieje Najlepszy?
Paradygmaty Programowania: Czy Istnieje Najlepszy?Paradygmaty Programowania: Czy Istnieje Najlepszy?
Paradygmaty Programowania: Czy Istnieje Najlepszy?
Netguru
 

Plus de Netguru (20)

Payments integration: Stripe & Taxamo
Payments integration: Stripe & TaxamoPayments integration: Stripe & Taxamo
Payments integration: Stripe & Taxamo
 
Hidden Gems in Swift
Hidden Gems in SwiftHidden Gems in Swift
Hidden Gems in Swift
 
KISS Augmented Reality
KISS Augmented RealityKISS Augmented Reality
KISS Augmented Reality
 
Why Would A Programmer Fall In Love With SPA?
Why Would A Programmer Fall In Love With SPA?Why Would A Programmer Fall In Love With SPA?
Why Would A Programmer Fall In Love With SPA?
 
Defining DSL (Domain Specific Language) using Ruby
Defining DSL (Domain Specific Language) using RubyDefining DSL (Domain Specific Language) using Ruby
Defining DSL (Domain Specific Language) using Ruby
 
How To Build Great Relationships With Your Clients
How To Build Great Relationships With Your ClientsHow To Build Great Relationships With Your Clients
How To Build Great Relationships With Your Clients
 
Agile Retrospectives
Agile RetrospectivesAgile Retrospectives
Agile Retrospectives
 
Ruby Rails Overview
Ruby Rails OverviewRuby Rails Overview
Ruby Rails Overview
 
From Birds To Bugs: Testowanie Z Pasją
From Birds To Bugs: Testowanie Z PasjąFrom Birds To Bugs: Testowanie Z Pasją
From Birds To Bugs: Testowanie Z Pasją
 
Communication With Clients Throughout The Project
Communication With Clients Throughout The ProjectCommunication With Clients Throughout The Project
Communication With Clients Throughout The Project
 
Everyday Rails
Everyday RailsEveryday Rails
Everyday Rails
 
Estimation myths debunked
Estimation myths debunkedEstimation myths debunked
Estimation myths debunked
 
Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?
 
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
Z 50 do 100 w ciągu roku Jak rekrutować w IT?Z 50 do 100 w ciągu roku Jak rekrutować w IT?
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
 
Paradygmaty Programowania: Czy Istnieje Najlepszy?
Paradygmaty Programowania: Czy Istnieje Najlepszy?Paradygmaty Programowania: Czy Istnieje Najlepszy?
Paradygmaty Programowania: Czy Istnieje Najlepszy?
 
Czy Project Manger Musi Być Osobą Techniczną?
Czy Project Manger Musi Być Osobą Techniczną?Czy Project Manger Musi Być Osobą Techniczną?
Czy Project Manger Musi Być Osobą Techniczną?
 
CSS architecture: How To Write Clean & Scalable Code
CSS architecture: How To Write Clean & Scalable CodeCSS architecture: How To Write Clean & Scalable Code
CSS architecture: How To Write Clean & Scalable Code
 
Ruby On Rails Intro
Ruby On Rails IntroRuby On Rails Intro
Ruby On Rails Intro
 
Perfect Project Read Me (in a few steps)
Perfect Project Read Me (in a few steps)Perfect Project Read Me (in a few steps)
Perfect Project Read Me (in a few steps)
 
The Git Basics
The Git BasicsThe Git Basics
The Git Basics
 

Dernier

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Dernier (20)

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxBT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 

Front-End Dev Tools

  • 5. <section id="users"> <div class="user" data-user-id="45"> <strong class="user__nickname"> czajkovsky </strong> Some info about this user. </</div> </section> HTML HTMLVSHAML&SLIM
  • 6. <section id="users"> <div class="user" data-user-id="45"> <strong class="user__nickname"> czajkovsky </strong> Some info about this user. </</div> </section> HTML HAML %section#users .user{ data: { user_id: 45 } } %strong.user__nickname czajkovsky Some info about this user. HTMLVSHAML&SLIM
  • 7. <section id="users"> <div class="user" data-user-id="45"> <strong class="user__nickname"> czajkovsky </strong> Some info about this user. </</div> </section> HTML SLIM section#users .user data-user-id=45 strong.user__nickname czajkovsky | Some info about this user. HAML %section#users .user{ data: { user_id: 45 } } %strong.user__nickname czajkovsky Some info about this user. HTMLVSHAML&SLIM
  • 8. <section id="users"> <div class="user" data-user-id="45"> <strong class="user__nickname"> czajkovsky </strong> Some info about this user. </</div> </section> HTML SLIM section#users .user data-user-id=45 strong.user__nickname czajkovsky | Some info about this user. HAML %section#users .user{ data: { user_id: 45 } } %strong.user__nickname czajkovsky Some info about this user. enforcesondevelopercorrect indent youdon’thavetorememberabout closingtags codeismuchshorter PROS HTMLVSHAML&SLIM
  • 9. <section id="users"> <div class="user" data-user-id="45"> <strong class="user__nickname"> czajkovsky </strong> Some info about this user. </</div> </section> HTML SLIM section#users .user data-user-id=45 strong.user__nickname czajkovsky | Some info about this user. HAML %section#users .user{ data: { user_id: 45 } } %strong.user__nickname czajkovsky Some info about this user. enforcesondevelopercorrect indent youdon’thavetorememberabout closingtags codeismuchshorter PROS newdevelopermustbefamiliarwithit (learningtakes20minutes) CONS? HTMLVSHAML&SLIM
  • 10. <section id="users"> <div class="user" data-user-id="45"> <strong class="user__nickname"> czajkovsky </strong> Some info about this user. </</div> </section> HTML SLIM section#users .user data-user-id=45 strong.user__nickname czajkovsky | Some info about this user. HAML %section#users .user{ data: { user_id: 45 } } %strong.user__nickname czajkovsky Some info about this user. enforcesondevelopercorrect indent youdon’thavetorememberabout closingtags codeismuchshorter PROS newdevelopermustbefamiliarwithit (learningtakes20minutes) CONS? Slim isfaster Slim allowsyoutodefinecustom shortcuts HAMLismorepopular HAMLVSSLIM HTMLVSHAML&SLIM
  • 11. .users { background: #fff; } .users h3 { color: #000; } CSS CSSvsSass(SCSS)
  • 12. .users { background: #fff; } .users h3 { color: #000; } CSS SCSS .users { background: #fff; h3 { color: #000; } } CSSvsSass(SCSS)
  • 13. .users { background: #fff; } .users h3 { color: #000; } CSS Sass .users background: #fff; h3 color: #000; SCSS .users { background: #fff; h3 { color: #000; } } CSSvsSass(SCSS)
  • 14. .users { background: #fff; } .users h3 { color: #000; } CSS Sass .users background: #fff; h3 color: #000; SCSS .users { background: #fff; h3 { color: #000; } } codeismoreDRY,muchshorterandeasier tomaintain Pros CSSvsSass(SCSS)
  • 15. .users { background: #fff; } .users h3 { color: #000; } CSS Sass .users background: #fff; h3 color: #000; SCSS .users { background: #fff; h3 { color: #000; } } codeismoreDRY,muchshorterandeasier tomaintain Pros nocons:) Cons CSSvsSass(SCSS)
  • 16. .users { background: #fff; } .users h3 { color: #000; } CSS Sass .users background: #fff; h3 color: #000; SCSS .users { background: #fff; h3 { color: #000; } } codeismoreDRY,muchshorterandeasier tomaintain Pros nocons:) Cons Sasshasmoreconcisesyntax (doesn’trequirecurlybrackets,semicolons) SCSSiscompatiblewithCSS SassvsSCSS CSSvsSass(SCSS)
  • 17. Variables $width: 1rem; .foo { width: $width; height: $width; } SCSS .foo { width: 1rem; height: 1rem; } CSS Sassvariables&referencesymbol
  • 18. Variables $width: 1rem; .foo { width: $width; height: $width; } SCSS .foo { width: 1rem; height: 1rem; } CSS Referencesymbol .foo { color: #f00; &.bar { height: #000; } } SCSS .foo { color: #f00; } .foo.bar { color: #000; } CSS Sassvariables&referencesymbol
  • 19. Variables $width: 1rem; .foo { width: $width; height: $width; } SCSS .foo { width: 1rem; height: 1rem; } CSS Referencesymbol .foo { color: #f00; &.bar { height: #000; } } SCSS .foo { color: #f00; } .foo.bar { color: #000; } CSS .foo { color: #f00; .ie7 & { height: #000; } } SCSS .foo { color: #f00; } .ie7 .foo { color: #000; } CSS Sassvariables&referencesymbol
  • 20. Referencesymbol-BEM syntax(Sass3.3) .user { &__nickname { color: #f00; } &--unverified { background: #00f; }} } SCSS .user__nickname { color: #f00; } .user--unverified { background: #00f; } CSS SassBEMsyntax
  • 21. Referencesymbol-BEM syntax(Sass3.3) .user { &__nickname { color: #f00; } &--unverified { background: #00f; }} } SCSS .user__nickname { color: #f00; } .user--unverified { background: #00f; } CSS CSSreflectsHTMLstructure easiertoread Pros HTMLclassesnamescanbelong Cons SassBEMsyntax
  • 22. Mixins @mixin square($size) { width: $size; height: $size; } .post { @include square(1rem); }} SCSS .post { width: 1rem; height: 1rem; } CSS Sassmixins&functions
  • 23. Mixins @mixin square($size) { width: $size; height: $size; } .post { @include square(1rem); }} SCSS .post { width: 1rem; height: 1rem; } CSS Functions @function double($value) { @return $value * 2; } .post { width: double(14px); } SCSS .post { width: 28px; } CSS Sassmixins&functions
  • 24. @extendthebadway .button { border-color: #f00; } .button--big { @extend .button; background: #00f; }} SCSS .button, .button--big { border-color: #f00; } .button--big { background: #00f; } CSS Sass@extend,placeholders
  • 25. @extendthebadway .button { border-color: #f00; } .button--big { @extend .button; background: #00f; }} SCSS .button, .button--big { border-color: #f00; } .button--big { background: #00f; } CSS Placeholders %button { border-color: #f00; } .button--big { @extend %button; background: #00f; }} SCSS .button--big { border-color: #f00; } .button--big { background: #00f; } CSS Sass@extend,placeholders
  • 26. If .post { @if ($dark == true) { color: #000; } @else { color: #fff; } }} .post { color: if($dark == true, #000, #fff); } Sassifs,loops&maps
  • 27. For @for $i from 3 through 1 { h#{4 - $i} { font-size: 2rem * $i; } } If .post { @if ($dark == true) { color: #000; } @else { color: #fff; } }} .post { color: if($dark == true, #000, #fff); } Sassifs,loops&maps
  • 28. Each $alerts: (error, red, 1px), (success, green, 2px), (info, blue, 2px); @each $type, $color, $border in $alerts { .alert--#{$type} { border: $border solid $color; }} } For @for $i from 3 through 1 { h#{4 - $i} { font-size: 2rem * $i; } } If .post { @if ($dark == true) { color: #000; } @else { color: #fff; } }} .post { color: if($dark == true, #000, #fff); } Sassifs,loops&maps
  • 29. Each $alerts: (error, red, 1px), (success, green, 2px), (info, blue, 2px); @each $type, $color, $border in $alerts { .alert--#{$type} { border: $border solid $color; }} } Maps $indexes: ( menu: 999, badge: 1050 ); .foo { z-index: map-get($indexes, menu); }} For @for $i from 3 through 1 { h#{4 - $i} { font-size: 2rem * $i; } } If .post { @if ($dark == true) { color: #000; } @else { color: #fff; } }} .post { color: if($dark == true, #000, #fff); } Sassifs,loops&maps
  • 30. @contentdirective @mixin media($device, $only: false) { ... @media screen and (min-width: $min-width) { @content; } ... }} // full mixin https://netguru.co/blog/categories/css .foo { @include media(tablet, true) { background: #f00; } } SCSS Sass@contentdirective
  • 31. @contentdirective @mixin media($device, $only: false) { ... @media screen and (min-width: $min-width) { @content; } ... }} // full mixin https://netguru.co/blog/categories/css .foo { @include media(tablet, true) { background: #f00; } } SCSS @media screen and (min-width: 48rem) and (max-width: 62rem) { .foo { background: #f00; } } CSS Sass@contentdirective
  • 32. class Lecture constructor: (@title, @author) -> @slides = [] display_date: -> if @date? then @date else "Sorry, no info about date for #{@title}" add_slide: (name, duration) -> slide = name: name duration: duration @slides.push slide long_slides: -> s.name for s in @slides when s.duration > 3 CoffeeScript
  • 33. class Lecture constructor: (@title, @author) -> @slides = [] display_date: -> if @date? then @date else "Sorry, no info about date for #{@title}" add_slide: (name, duration) -> slide = name: name duration: duration @slides.push slide long_slides: -> s.name for s in @slides when s.duration > 3 CoffeeScript codeisshorterby1/3withoutany incluenceonexecutiontime (iscompiledtoJS) syntax(defaultinRoRfromversion3.1) Pros
  • 34. class Lecture constructor: (@title, @author) -> @slides = [] display_date: -> if @date? then @date else "Sorry, no info about date for #{@title}" add_slide: (name, duration) -> slide = name: name duration: duration @slides.push slide long_slides: -> s.name for s in @slides when s.duration > 3 CoffeeScript codeisshorterby1/3withoutany incluenceonexecutiontime (iscompiledtoJS) syntax(defaultinRoRfromversion3.1) Pros syntax Cons
  • 35. CoffeeScript @id # this.id class Lecture @findByTitle: (title) -> ... @Alias
  • 36. CoffeeScript 'foo exists' if foo? # typeof foo !== "undefined" && # foo !== null foo?.prop?.subprop? foo.prop ?= 'new val' Existentialoperator @id # this.id class Lecture @findByTitle: (title) -> ... @Alias
  • 37. CoffeeScript 'foo exists' if foo? # typeof foo !== "undefined" && # foo !== null foo?.prop?.subprop? foo.prop ?= 'new val' Existentialoperator @id # this.id class Lecture @findByTitle: (title) -> ... @Alias # foo = { bar: 1, baz: 2 } foo = bar: 1 baz: 2 # range = [2, 3, 4, 5] range = [2..5] Objects,arrays
  • 38. CoffeeScript 'foo exists' if foo? # typeof foo !== "undefined" && # foo !== null foo?.prop?.subprop? foo.prop ?= 'new val' Existentialoperator @id # this.id class Lecture @findByTitle: (title) -> ... @Alias # foo = { bar: 1, baz: 2 } foo = bar: 1 baz: 2 # range = [2, 3, 4, 5] range = [2..5] Objects,arrays for name, i in ['HAML', 'CSS', 'JS'] alert "#{i}: #{name}" # a = [{ name: 'HAML', duration: 5 }, ...] s.name for s in a when s.duration > 3 Loops&comprehensions
  • 39. CoffeeScript foo = (bar) -> # your function body square = (x) -> x * x power = (a = 1, b = 2) -> Math.pow(a, b) Functions
  • 40. CoffeeScript foo = (bar) -> # your function body square = (x) -> x * x power = (a = 1, b = 2) -> Math.pow(a, b) Functions foo: -> # your function body "this will be returned" Autoreturn
  • 41. CoffeeScript foo = (bar) -> # your function body square = (x) -> x * x power = (a = 1, b = 2) -> Math.pow(a, b) Functions 'boring...' if sleeping_folks > 2 unless foo is 1 if bar isnt 2 and baz is 7 'mid-length' if 3 < l.duration < 5 Flowcontrol foo: -> # your function body "this will be returned" Autoreturn
  • 42. CoffeeScript foo = (bar) -> # your function body square = (x) -> x * x power = (a = 1, b = 2) -> Math.pow(a, b) Functions 'boring...' if sleeping_folks > 2 unless foo is 1 if bar isnt 2 and baz is 7 'mid-length' if 3 < l.duration < 5 Flowcontrol foo: -> # your function body "this will be returned" Autoreturn "#{title} by #{author}" # OK '#{title} by #{author}' # won't work Interpolation
  • 43. CoffeeScript class Lecture prepare: (@subject) -> notify: -> alert @subject() class Speaker constructor: (@name) -> @lecture = new Lecture @lecture.prepare () => "New lecture by #{@name}" p = new Speaker('czajkovsky') p.lecture.notify() Fatarrow
  • 44. CoffeeScript class Lecture prepare: (@subject) -> notify: -> alert @subject() class Speaker constructor: (@name) -> @lecture = new Lecture @lecture.prepare () => "New lecture by #{@name}" p = new Speaker('czajkovsky') p.lecture.notify() Fatarrow [month, day, year] = 'June 2 14'.split ' ' Multipleassignment
  • 45. class Lecture constructor: (@title, @author) -> @slides = [] display_date: -> if @date? then @date else "Sorry, no info about date for #{@title}" long_slides: -> s.name for s in @slides when s.duration > 3 add_slide: (name, duration) -> slide = name: name duration: duration @slides.@slides.push slide CoffeeScript
  • 46. class Lecture constructor: (@title, @author) -> @slides = [] display_date: -> if @date? then @date else "Sorry, no info about date for #{@title}" long_slides: -> s.name for s in @slides when s.duration > 3 add_slide: (name, duration) -> slide = name: name duration: duration @slides.@slides.push slide l = new Lecture('Front-end tools', 'czajkovsky') l.display_date() # Sorry, no info about date for Front-end tools CoffeeScript
  • 47. class Lecture constructor: (@title, @author) -> @slides = [] display_date: -> if @date? then @date else "Sorry, no info about date for #{@title}" long_slides: -> s.name for s in @slides when s.duration > 3 add_slide: (name, duration) -> slide = name: name duration: duration @slides.@slides.push slide l = new Lecture('Front-end tools', 'czajkovsky') l.display_date() # Sorry, no info about date for Front-end tools l.date = '02/06/2014 18:30' l.display_date() # 02/06/2014 18:30 CoffeeScript
  • 48. class Lecture constructor: (@title, @author) -> @slides = [] display_date: -> if @date? then @date else "Sorry, no info about date for #{@title}" long_slides: -> s.name for s in @slides when s.duration > 3 add_slide: (name, duration) -> slide = name: name duration: duration @slides.@slides.push slide l = new Lecture('Front-end tools', 'czajkovsky') l.display_date() # Sorry, no info about date for Front-end tools l.date = '02/06/2014 18:30' l.display_date() # 02/06/2014 18:30 l.add_slide(l.add_slide('HAML', 2) l.add_slide('Sass', 5) l.add_slide('CoffeeScript', 4) l.long_slides() # ["Sass", "CoffeeScript"] CoffeeScript