SlideShare a Scribd company logo
jQuery Anti-Patterns for
Performance &
Compression
Paul Irish
NC JavaScript Camp ’10
jQuery Anti-Patterns for
Performance &
Compression
Paul Irish
NC JavaScript Camp ’10
Me.
Interaction Designer at Molecular, Inc.
jQuery Team Member - Dev. Relations


     @paul_irish
http://paulirish.com Front-end development blog
http://aurgasm.us Eclectic music blog
Performance
Performance
wassup shawty? how u doin’
                  Taskspeed Test Lines of Code
200



150



100



50



 0
      YUI   Dojo 1.3.1 Dojo 1.2.3 Qooxdoo MooTools Prototype.js   jQuery   PureDOM
Oft cited best practices
 Cache length during loops
 Cache your selections
 Leverage documentFragment
 Append new content outside the loop
Oft cited best practices
 Cache length during loops
// appending inside. bad.
$.each(reallyLongArray, function(count, item) {
 Cache your selections
    var newLI = '<li>' + item + '</li>';
    $('#ballers').append(newLI);
 Leverage documentFragment
});
 Append new content outside the loop
// documentFragment off-DOM
var frag = document.createDocumentFragment();
$.each(reallyLongArray, function(count, item) {
    var newLI = '<li>' + item + '</li>';
    frag.appendChild(newLI[0]);
});
$('#ballers')[0].appendChild(frag);
var newLI = '<li>' + item + '</li>';
      $('#ballers').append(newLI);

Oft cited best practices
});

// documentFragment off-DOM
var frag = document.createDocumentFragment();
 Cache length during loops
$.each(reallyLongArray, function(count, item) {
    var newLI = '<li>' + item + '</li>';
 Cache your selections
    frag.appendChild(newLI[0]);
});
 Leverage documentFragment
$('#ballers')[0].appendChild(frag);

 Append new content outside the loop
// string concatenate and set innerHTML
var myhtml = '';
$.each(reallyLongArray, function(count, item) {
    myhtml += '<li>' + item + '</li>';
});
$('#ballers').html(myhtml);
Keep things DRY

 If you’re repeating
 yourself, you’re doing it
 wrong
Moar DRY plz?

if ($ventfade.data('currently') != 'showing') {
  $ventfade.stop();
}
if ($venthover.data('currently') != 'showing') {
  $venthover.stop();
}
if ($spans.data('currently') != 'showing') {
  $spans.stop();
}



                       from http://mt-ventures.com/_js/global.js
All clean! Thx

var elems = [$ventfade,$venthover,$spans];

$.each(elems,function(k,v){
    if (v.data('currently') != 'showing'){
         v.stop();
    }
})
Architecture Anti-Patterns
 Anonymous functions bound everywhere suck
$(document).ready(function(){
    ...
    $('#magic').click(function(e){

            $('#yayeffects').slideUp(function(){
                ...
            });
      });

      $('#happiness').load(url+' #unicorns',function(){
          ...
      })
});
Architecture - Object Literal
var PI = {
  onReady   : function(){
      ...
      $('#magic').click(PI.candyMtn);
      $('#happiness').load(url+' #unicorns',PI.unicornCb);
  },
  candyMtn : function(e){
     $('#yayeffects').slideUp(PI.slideCb);
  },
  slideCb   : function(){
      ...
  },
  unicornCb : function(){
      ...
  }
}

$(document).ready(PI.onReady);
Architecture - Object Literal
 Advantages:
  Easier to navigate and discuss
  Profilers give you actual names to work with
  You can execute these from firebug console
  You can write unit tests against them
Anti-Pattern: The requery
// create and append your element
$(document.body).append("<div class='baaron'/>");
// requery to bind stuff
$("div.baaron").click(function(){});




// better:
// swap to appendTo to hold your elem
$("<div class='baaron'/>")
    .appendTo(document.body)
    .click(function(){});
$(‘#whats .the’,context)
This is not the .context property

  // find all stylesheets in the body
  var bodySheets = $('style',document.body);
  bodySheets.context // ==> BODY element


  Ignore that for the moment, I know no one that’s
  found a use
$(‘#whats .the’,context)
 Never pass it a selector string. Ever.
 No performance gain vs $(root).find(selector)

   var arms = $('div.robotarm', '#container');
   // instead do:
   var arms = $('#container').find('div.robotarm');
$(‘#whats .the’,context)
 You typically pass it this, but it’s purely a
 convenience to avoid find()

 $('form.comments',this).submit(captureSubmit);
 // exact same as
 $(this).find('form.comments').submit(captureSubmit);


 Which is more readable?

$('.reply_form', $(this).closest('.comment')).hide();

$(this).closest('.comment').find('.reply_form').hide();
The Crowd Say Bo Selector
Come on, my selector
Selector engines have come a long, long way.
Come on, my selector
Selector engines have come a long, long way.
Come on, my selector
Engines work in different ways
Top-down, bottom-up, function creation, other crazy shit


// from NWMatcher:

// selecting '.outmost #outer span'


T=e.nodeName;if(T=="SPAN"||T=="span")
{while((e=e.parentNode)&&e.nodeType==1)
{if((n=e.getAttributeNode("id"))&&n.value=="outer")
{if((e=e.parentNode)&&e.nodeType==1)
{C=e.className;if(C&&(" "+C+" ").indexOf(" outmost ")>-1)
{r[X++]=N;continue main;}}}}}
Selector engines, parse direction
 Left to right (Top-down)      Right to left (Bottom-up)

        Mootools                           Sizzle

           Sly                             YUI 3

         Peppy                         NWMatcher

       Dojo Acme

         Ext JS

      Prototype.js
                        details: http://alexsexton.com/selectors/
Selector engines, parse direction
  div.data table.attendees .gonzalez

 Left to right (Top-down)      Right to left (Bottom-up)

        Mootools                           Sizzle

           Sly                             YUI 3

         Peppy                         NWMatcher

       Dojo Acme

         Ext JS

      Prototype.js
                        details: http://alexsexton.com/selectors/
Selector engines, parse direction
 Left to right (Top-down)      Right to left (Bottom-up)

        Mootools                           Sizzle

           Sly                             YUI 3

         Peppy                         NWMatcher

       Dojo Acme

         Ext JS

      Prototype.js
                        details: http://alexsexton.com/selectors/
Selector engines, parse direction
 Left to right (Top-down)      Right to left (Bottom-up)

        Mootools                           Sizzle

           Sly                             YUI 3

         Peppy                         NWMatcher

       Dojo Acme                 querySelectorAll (qSA)

         Ext JS

      Prototype.js
                        details: http://alexsexton.com/selectors/
Selector Optimization
 Specific on the right, light on the left

 // let's find scott
 div.data .gonzalez

 // specific on right, light on the left
 .data td.gonzalez



 tag.class if possible on your right-most selector.
 just tag or just .class on left.
Selector Optimization
 Of course, descending from an #id is best


// basic #id-based selector
var arms = $('#container div.robotarm');

// hyper-optimized #id case first, then find:
var arms = $('#container').find('div.robotarm');
Selector Optimization
 Don’t be needlessly specific

 // let's find scott
 .data table.attendees td.gonzalez

 // better: drop the middle
 .data td.gonzalez




A flatter DOM helps, so move to HTML5
   Also a wider range of tags speeds up filters
Selector Optimization
 Avoid the universal selector
 Avoid the implied universal selector

 $('.buttons > *') // terribly costly
 $('.buttons').children() // much better




 $('.gender :radio') // implied universal
 $('.gender *:radio') // exact same, explicit now
 $('.gender input:radio') // much better
Selector Optimization
 Google PageSpeed’s efficient selectors analysis
 MDC: Writing Efficient CSS
  https://developer.mozilla.org/en/Writing_Efficient_CSS

 Benchmark.js
  http://code.paulirish.com/sandbox/benchmark.js
Event Delegation
 function delegate(type, delegate, handler) {
     return $(document).bind(type, function(event) {
         var target = $(event.target);
         if (target.is(delegate)) {
             return handler.apply(target, arguments);
         }
     });
 }

 delegate('click','td.jehl',createRockstar);

 // and with live():
 $('td.jehl').live('click',createRockstar);
Event Delegation
live() isn’t just for dynamic content
Speeds up page load
  Only one event handler is bound vs many
Good for >3 elements all getting the same handler

 // using live(), skipping selection on load
 var jqElem = $(document);
 jqElem.selector = 'li.ui';
 jqElem.live('dblclick', dblhandler);
Event Delegation
live() isn’t just for dynamic content
Speeds up page load
  Only one event handler is bound vs many
Good for >3 elements all getting the same handler

 // using live(), skipping selection on load
 var jqElem = $(document);
 jqElem.selector = 'li.ui';
 jqElem.live('dblclick', dblhandler);
Event Delegation
   delegate() bakes in huge performance gains
   explicit context reduces overhead by ~80%
   Use it instead of live() if possible


// awkward but equivalent
$('a.trigger',$('#container')[0]).live('click',handlerFn)

// so damn fine
$('#container').delegate('click','a.trigger',handlerFn)
Event Delegation                               new
                                                        in
                                                1.4
                                                    .2!
   delegate() bakes in huge performance gains
   explicit context reduces overhead by ~80%
   Use it instead of live() if possible


// awkward but equivalent
$('a.trigger',$('#container')[0]).live('click',handlerFn)

// so damn fine
$('#container').delegate('click','a.trigger',handlerFn)
The DOM is slow
Pull elements off the DOM while you toy with them

var table = $('#some-table');
var parent = table.parent();

table.detach();
table.addLotsAndLotsOfRows();
parent.append(table);
The DOM is slow
Pull elements off the DOM while you toy with them

var table = $('#some-table');
var parent = table.parent();
                                         new
table.detach();
                                       in 1
                                            .4
table.addLotsAndLotsOfRows();
parent.append(table);
Minimize DOM touches
       Use classes, but if a style change user-selected:

  jQuery('a.swedberg').css('color', '#BADA55');

  jQuery('<style type="text/css"> a.swedberg { color: BADA55; } </style>')
    .appendTo('head');



                                                         Timings for X elements
3000
2250                                                     (1000 iterations)

1500                                                          css()
                                                              style tag
750
  0
       1        5          10          20           50
Minimize DOM touches
Don’t treat jQuery as a Black Box
 Use the source as your documentation
 Add this to your bookmark bar, NOW!
   http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js
   http://bit.ly/jqsource
 Determine which are convenience methods:
   getScript: function( url, callback ) {
       return jQuery.get(url, null, callback, "script");
   },
   getJSON: function( url, data, callback ) {
       return jQuery.get(url, data, callback, "json");
   },
Don’t treat jQuery as a Black Box
 Learn the lesser-known methods
   map(), slice(), stop(), (de)queue(),
   prevAll(), pushStack(), inArray() , etc

 // index() in jQuery <= 1.3.2
 $('#rdworth').parent().children().index( $('#rdworth')[0] )

 // using prevAll() is 10% faster (also sexier)
 $('#rdworth').prevAll().length

 // in jQuery 1.4
 $('#rdworth').index()
Don’t act on absent elements
 jQuery is very kind and doesn’t throw errors at you
 Don’t assume it’s just fine to do

   $('#doesntexist').slideUp()
   // this will execute genFx(), speed() and animate()
   //   before it hits an each()



 jQuery UI widgets have a lot of overhead you’ll hit
Don’t act on absent elements

 jQuery.fn.doOnce = function(func){
     this.length && func.apply(this);
     return this;
 }


 $('li.cartitems').doOnce(function(){
     // make it ajax! o/
 });
Don’t act on absent elements


 $.fn.plugin = function(opts){
    if(!this.length) return this;
    var opts = $.extend(......
    ...
    return this.each(...
Setter Methods



view-source:setters.js
new
New Element Creation                        1.4
                                                !
                                                  in

jQuery("<div/>", {
    id: "foo",
    rel : "something"
    css: {
        height: "50px",
        width: "50px",
        color: "blue",
        backgroundColor: "#ccc"
    },
    click: function() {
       $(this).css("backgroundColor", "red");
    }
}).appendTo("body");
new
eq(), first(), last()                 1.4
                                         !
                                           in




var lastelem = $elems.eq(-1); // get() too!



$('#nav li:first') === $('#nav li').first()

$('#nav li:last') === $('#nav li').last()
Data()

// regular:
$(elem).data(key,value);

// omg like 10x faster:
$.data(elem,key,value);
Compression
Compression
YUI Compressor
  Sits on Rhino.
Comments, whitespace, variable replacement

//it already does these micro-optimizations:
object['prop'] ==> object.prop
{'key':123} ==> {key:123}
'jon's apostophes' ==> "jon's apostrophes"
'bigass ' + 'string' ==> 'bigass string'
Variable definition

// old 'n busted            // new hotness
var test1 = 1;              var test1 = 1,
var test2 = function() {        test2 = function() {
    // function code                // function code
};                              },
var test3 = test2(test1);       test3 = test2(test1);
Munge the primitives
Define shortcuts at the top of your scope
  Good for both compression and scope chain traversal


var TRUE = true,
    FALSE = false,
    NULL = null,
    window = self,
    undefined = undefined;
Munge the primitives
Define shortcuts at the top of your scope
  Good for both compression and scope chain traversal


var TRUE = true,
    FALSE = false,
    NULL = null,
    window = self,
    undefined;
    undefined = undefined;
Munge the primitives

(function(){
   var window = this, document = document,
undefined;
   /* code */
})();


(function(window, document, undefined){
   /* code */
})(this,this.document);
var str=‘Let’s put this into action’

 // html.no-js html>
 <!doctype ==> html.js
 var elem = document.getElementsByTagName('html')[0];
 elem.className = elem.className.replace('no-js','js');
 <html class="no-js">
 // quicker reference, safer replace
 <head>
 var elem = document.documentElement;
 elem.className = elem.className.replace(/bno-jsb/,'js');
    <script>
 // one// change the html class to 'js'
        line ftw!
       // in the head, no FOUC
 document.documentElement.className =
 document.documentElement.className.replace(/bno-jsb/,
    </script>
 'js');
 </body>
 // shorter with a self-executing anonymous function
 (function(B){B.className=B.className.replace(/bno-jsb/,
var str=‘Let’s put this into action’

 // html.no-js ==> html.js
 var elem = document.getElementsByTagName('html')[0];
 elem.className = elem.className.replace('no-js','js');

 // quicker reference, safer replace
 var elem = document.documentElement;
 elem.className = elem.className.replace(/bno-jsb/,'js');

 // one line ftw!
 document.documentElement.className =
 document.documentElement.className.replace(/bno-jsb/,
 'js');

 // shorter with a self-executing anonymous function
 (function(B){B.className=B.className.replace(/bno-jsb/,
// html.no-js ==> html.js
var elem = document.getElementsByTagName('html')[0];

var str=‘Let’s put this into action’
elem.className = elem.className.replace('no-js','js');

// quicker reference, safer replace
var elem = document.documentElement;
elem.className = elem.className.replace(/bno-jsb/,'js');

// one line ftw!
document.documentElement.className =
document.documentElement.className.replace(/bno-jsb/,
'js');

// shorter with a self-executing anonymous function
(function(B){B.className=B.className.replace(/bno-jsb/,
'js')})(document.documentElement);

// pass className, object string notation
(function(H,C){H[C]=H[C].replace(/bno-jsb/,'js')})
(document.documentElement,'className')
Conditionals


// old 'n busted
if ( type === 'foo' || type === 'bar' ) {}

// regex test
if ( /^(foo|bar)$/.test(type) ) {}

// obj literal lookup (smaller if <5 items)
if ( ({foo:1,bar:1})[type] ) {}
Logic and Ternary operands
// basic function detection
document.querySelectorAll && document.querySelectorAll('a:nth-child(2)')

// assignment is legal, but it evaluates to the right expression
callback && (isCallbackCalled = true) && callback(returnVal);

// call or cache the callback function
(isCallbackCalled || returnVal) ? fn(returnVal) : (callback = fn);

// inline function calls
isToday('Saturday') && Math.round(Math.random()) && $('#winnar').show()

// if JSON2.js or Native JSON is present, otherwise eval.
data = window.JSON && JSON.parse(data) || eval('('+data +')');
Write maintainable code
                   As a developer,

       you should work first   and foremost
            for the user of your products.
  The second most important person to work for is
        the developer that takes over from you.
                                   - Christian Heilmann
Comments
/*!
 * Will not be removed by YUI Compressor
 */



// for quick toggling on and off:
/* */
 aaaahYeah();
/* */

/* * /
 ohHellNo();
/* */
Compression Tools
CompressorRater
  http://compressorrater.thruhere.net/
YUI Compressor front-end
  http://refresh-sf.com/yui/
Thanks, ya’ll.
 Slides at http://paulirish.com/perf


      @paul_irish




thx:
 Alex Sexton, Ben Alman, Adam Sontag,
 James Padolsey, temp01, #jquery on Freenode
todo
shadow effect to code samples
more context research and this: http://
groups.google.com/group/jquery-dev/msg/
b4b7935a4013dfe7 and http://ispeakwebstuff.co.uk/
web-design-development-tutorials/clever-jquery-
selectors/
`
    // pngfix for IE6
    // e.g. FL.pngfix('img.bigProdShot,a.thumb');
    pngfix : function(sel){
      // conditional comments for inclusion of that js.
      if (typeof DD_belatedPNG == 'undefined'){ return;
      } else {
        // delay pngfix until window onload
        $(window).load(function(){ $(sel).each(function()
    { DD_belatedPNG.fixPng(arguments[1]); }); });
      }
    } // end of FL.pngfix()

More Related Content

Viewers also liked (18)

Finite State Machines and C++ by Klika Tech, Inc, has 28 slides with 755 views.Finite-state machine introduction and motivation. Overview of few existing finite-state machines C++ implementations (Qt, Boost, etc.). Overview of using Boost.Statechart library. Best practices using Boost.Statechart and C++ code samples.
Finite State Machines and C++Finite State Machines and C++
Finite State Machines and C++
Klika Tech, Inc
28 slides755 views
Writing Scalable React Applications: Introduction by Klika Tech, Inc, has 27 slides with 644 views.Мы предлагаем курс из 2 лекций по React: - Первая лекция: React Basics - Вторая лекция: Dive into React На первой лекции мы расскажем, что такое React и его плюсы/минусы по отношению к другим решениям. Второй вебинар, более практический, опишет, как писать приложения с использованием библиотеки React.
Writing Scalable React Applications: IntroductionWriting Scalable React Applications: Introduction
Writing Scalable React Applications: Introduction
Klika Tech, Inc
27 slides644 views
How to Write UI Automated Tests by Klika Tech, Inc, has 7 slides with 332 views.Report lightens up the starting points and the basics of what you need to know in order to get going with writing automated UI tests. Here Elena is touching upon the common automation stack of tools, the possible architecture of the test project and share the tips based on her personal experience. You can watch the practical example of a test creation and the talk could help you gain understanding of the main principles of tests writing and PageObject pattern usage.
How to Write UI Automated TestsHow to Write UI Automated Tests
How to Write UI Automated Tests
Klika Tech, Inc
7 slides332 views
Organization of Automated Testing by Klika Tech, Inc, has 26 slides with 241 views.The talk reviews the most significant elements of organization of automation for a project. It might help you decide whether automation is needed on your project. Report reviews the possible strategies of implementing the automation into life, touches upon the planning of the automation process and how can the profit acquired from automation be estimated by providing the return of investment calculation.
Organization of Automated TestingOrganization of Automated Testing
Organization of Automated Testing
Klika Tech, Inc
26 slides241 views
CAP theorem and distributed systems by Klika Tech, Inc, has 25 slides with 2353 views.The document discusses the CAP theorem which states that it is impossible for a distributed computer system to simultaneously provide consistency, availability, and partition tolerance. It defines these terms and explores how different systems address the tradeoffs. Consistency means all nodes see the same data at the same time. Availability means every request results in a response. Partition tolerance means the system continues operating despite network failures. The CAP theorem says a system can only choose two of these properties. The document discusses how different types of systems, like CP and AP systems, handle partitions and trade off consistency and availability. It also notes the CAP theorem is more nuanced in reality with choices made at fine granularity within systems.
CAP theorem and distributed systemsCAP theorem and distributed systems
CAP theorem and distributed systems
Klika Tech, Inc
25 slides2.4K views
[Tech Talks] Typesafe Stack Introduction by Klika Tech, Inc, has 13 slides with 244 views.Typesafe is a company founded by Martin Odersky, the creator of the Scala programming language, and Jonas Bonér, the creator of the Akka middleware in 2011. It provides an Open source platform for building Reactive applications for the JVM
[Tech Talks] Typesafe Stack Introduction[Tech Talks] Typesafe Stack Introduction
[Tech Talks] Typesafe Stack Introduction
Klika Tech, Inc
13 slides244 views
An Overview of HTML5 Storage by Paul Irish, has 43 slides with 2498 views.The document discusses HTML5 storage options such as localStorage, sessionStorage, Web SQL Database, IndexedDB, and Application Cache. It provides details on how to use each technology, including code examples and explaining use cases. It also covers current browser support and how to detect support for different storage options. The overall purpose is to explain why and how to use HTML5 storage technologies on the web.
An Overview of HTML5 StorageAn Overview of HTML5 Storage
An Overview of HTML5 Storage
Paul Irish
43 slides2.5K views
Introduction to Serverless by Nikolaus Graf, has 32 slides with 3576 views.Covers the concept behind serverless architectures, how Functions as a Service (FaaS) work and how to deploy such a serverless function.
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
Nikolaus Graf
32 slides3.6K views
jQuery Proven Performance Tips & Tricks by Addy Osmani, has 87 slides with 175694 views.Performance optimization is a crucial aspect of building ‘snappy’ client-side applications and something which all developers using jQuery should bear in mind. In this talk, we're going to take a look at some of the best practices, tips and tricks for improving the performance of your jQuery code in 2011 with some quick wins and a few new surprises along the way.
jQuery Proven Performance Tips & TricksjQuery Proven Performance Tips & Tricks
jQuery Proven Performance Tips & Tricks
Addy Osmani
87 slides175.7K views
Learning jQuery in 30 minutes by Simon Willison, has 31 slides with 53528 views.- jQuery is a JavaScript library that simplifies HTML document traversal and manipulation, as well as event handling, animation, and Ajax. - It works by allowing the selection of HTML elements and running functions on those elements via a simple and consistent API. - Common uses of jQuery include modifying HTML content, CSS styling, handling user events, animating elements, and loading data from web servers via Ajax.
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
Simon Willison
31 slides53.5K views
Extreme JavaScript Performance by Thomas Fuchs, has 105 slides with 64168 views.Talk given at http://jsconf.eu 2009. You serve up your code gzipped. Your caches are properly configured. Your data (and scripts) are loaded on-demand. That's awesome—so don't stop there. Runtime is another source of slowdowns, and you can learn to conquer those, too. Learn how to benchmark your code to isolate performance issues, and what to do when you find them. The techniques you'll learn range from the normal (function inlining) to the extreme (unrolling loops).
Extreme JavaScript PerformanceExtreme JavaScript Performance
Extreme JavaScript Performance
Thomas Fuchs
105 slides64.2K views
Trabalho sobre Queimaduras by Rui Alves, has 14 slides with 64780 views.Este documento descreve os tipos de queimaduras de acordo com a gravidade e os tecidos afetados, além de fornecer recomendações sobre o tratamento inicial e prevenção de queimaduras.
Trabalho sobre QueimadurasTrabalho sobre Queimaduras
Trabalho sobre Queimaduras
Rui Alves
14 slides64.8K views
NGINX Microservices Reference Architecture: Ask Me Anything by NGINX, Inc., has 20 slides with 535 views.On-demand recording: http://bit.ly/2mg6NZm The NGINX Microservices Reference Architecture (MRA) is getting big interest from software developers. Our recent webinar on Three Models in the MRA was one of our most popular ever. Now, microservices experts Chris Stetson and Ben Horowitz answer all your questions in this Ask Me Anything (AMA) session. Chris and Ben have helped to build Sirius Satellite Radio, Intel.com, Lexus.com, Microsoft.com, Visa.com, and many more. So come ready to ask Chris and Ben anything about the Microservices Reference Architecture! During this webinar, Chris and Ben answer questions about: - Which MRA model is best for your application - What problems microservices and the MRA solve - How to apply the MRA in your organization - What challenges others are facing
NGINX Microservices Reference Architecture: Ask Me AnythingNGINX Microservices Reference Architecture: Ask Me Anything
NGINX Microservices Reference Architecture: Ask Me Anything
NGINX, Inc.
20 slides535 views
React + Redux Introduction by Nikolaus Graf, has 47 slides with 26233 views.Introduction to React in combination with Redux. Redux helps you to develop applications in a simple way while having features like time-travel available during development.
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
Nikolaus Graf
47 slides26.2K views
Docker for Java Developers by NGINX, Inc., has 62 slides with 6094 views.On-demand recording: http://bit.ly/2mRhTRB If you’re a Java developer, you probably know that containers have begun to revolutionize application development and deployment. Developers across the world have adopted modern application stacks to more quickly develop and deploy their applications, and deliver the performance users expect. When the power of NGINX Plus and Docker is combined developers, system administrators, and application owners achieve something we all desire: flawless application delivery. In this webinar you will hear from Arun Gupta, a key visionary behind the development and success of Java, about why choosing technologies like Docker and NGINX can provide significant benefit to your applications. Arun Gupta will share key points which he discusses in his newly released book, Docker for Java Developers, from O’Reilly. Join us in this webinar to learn: * How Docker can improve your Java development lifecycle. * How to build and run Docker containers for Java applications * Tips for managing Docker containers in Java development environments * How to load balance Java applications running in Docker containers
Docker for Java DevelopersDocker for Java Developers
Docker for Java Developers
NGINX, Inc.
62 slides6.1K views
React JS and why it's awesome by Andrew Hull, has 132 slides with 108222 views.This document provides an overview of React, including initial reactions to it, fundamental concepts like components and one-way data flow, and how the virtual DOM works. Some key points covered include: - Initial reactions to React were mixed, with some finding it "ugly" but others seeing benefits like separation of concerns with components. - Everything in React is a component, with data flowing in one direction from parent to child via props. State is mutable within a component. - By using a virtual DOM, React can efficiently update the real DOM by only making necessary changes, keeping the interface fast and pure.
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
Andrew Hull
132 slides108.2K views
React js by Jai Santhosh, has 33 slides with 26598 views.This document introduces React, describing it as a JavaScript library for building user interfaces by rendering components rather than mutating the DOM directly. It discusses how React uses a virtual DOM for fast re-rendering, building components instead of templates, and the use of JSX syntax to write HTML-like code. Components have state and props, and the whole app re-renders when state changes to guarantee updates.
React jsReact js
React js
Jai Santhosh
33 slides26.6K views
Docker 101: Introduction to Docker by Docker, Inc., has 30 slides with 75775 views.This document provides an introduction to Docker. It discusses why Docker is useful for isolation, being lightweight, simplicity, workflow, and community. It describes the Docker engine, daemon, and CLI. It explains how Docker Hub provides image storage and automated builds. It outlines the Docker installation process and common workflows like finding images, pulling, running, stopping, and removing containers and images. It promotes Docker for building local images and using host volumes.
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
Docker, Inc.
30 slides75.8K views

Similar to jQuery Anti-Patterns for Performance & Compression (20)

Your Library Sucks, and why you should use it. by Peter Higgins, has 38 slides with 3316 views.This document discusses JavaScript libraries and proposes ideas for improving them. It argues that while libraries are useful, developers should understand JavaScript fundamentals first. Current libraries have inconsistent APIs and lack modularity. The document proposes a new "CommonBrowserJS" library with common standards, pure feature detection, and support for CommonJS modules to converge the best ideas from existing libraries. Developing a simple "has.js" library for feature detection could be a first step. Overall the document advocates for improving JavaScript libraries by standardizing APIs and reducing magic while embracing modern JavaScript practices.
Your Library Sucks, and why you should use it.Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.
Peter Higgins
38 slides3.3K views
Jquery Best Practices by brinsknaps, has 18 slides with 3422 views.The document discusses several best practices for optimizing jQuery code including: 1) Using more specific selectors for faster lookups, chaining methods instead of multiple lookups, and storing selections in variables. 2) Using .live() instead of .click() for event binding to improve performance. 3) Declaring variables together on one line and containing global variables in a namespace to reduce scope and conflicts. 4) Manipulating the DOM efficiently by inserting HTML fragments together instead of separately.
Jquery Best PracticesJquery Best Practices
Jquery Best Practices
brinsknaps
18 slides3.4K views
jQuery secrets by Bastian Feder, has 27 slides with 2281 views.This document summarizes jQuery secrets presented by Bastian Feder. It discusses utilities like jQuery.data() and jQuery.removeData() for saving and removing state on DOM elements. It also covers AJAX settings, events, extending jQuery, and jQuery plugins. The presentation provides code examples for working with data, events, namespaces, AJAX, and extending jQuery functionality.
jQuery secretsjQuery secrets
jQuery secrets
Bastian Feder
27 slides2.3K views
Cheap frontend tricks by ambiescent, has 71 slides with 476 views.The document discusses various techniques for improving web applications, including: 1. Enabling in-place AJAX reloading of pages using jQuery. 2. Optimizing page loads by only rendering necessary content for AJAX requests. 3. Adding hash URLs to enable back-button functionality when using AJAX. 4. Improving cross-browser compatibility by detecting browsers and conditional loading of styles.
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricks
ambiescent
71 slides476 views
jQuery - 10 Time-Savers You (Maybe) Don't Know by girish82, has 15 slides with 2271 views.This document discusses 10 time-saving techniques for jQuery and JavaScript: 1. Limit DOM traversal to improve performance. 2. Use chaining for cleaner code and better readability. 3. Be specific with selectors like :first-child to avoid universal selectors. 4. Understand events like .each(), .live(), and .delegate() and use appropriately. 5. Create DOM elements in memory then append for better performance. 6. Bind fewer events by checking the target of the event. 7. Choose events like .ready() and .load() carefully based on needs. 8. Think right-to-left for selectors except IDs
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
girish82
15 slides2.3K views
jQuery in the [Aol.] Enterprise by Dave Artz, has 65 slides with 5987 views.Last year, AOL adopted a new content strategy and has positioned itself as a premier destination for original content. Core to this strategy is having reusable, highly efficient and optimized common code and experiences at scale, which is where jQuery comes in. Check in with Dave Artz to see how jQuery has helped his front-end standards team tackle unique challenges like optimizing 3rd party widget performance, overriding plugin functionality, and managing dependencies and updates across 100+ sites spanning multiple back-end platforms.
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
Dave Artz
65 slides6K views
international PHP2011_Bastian Feder_jQuery's Secrets by smueller_sandsmedia, has 28 slides with 422 views.This document contains a summary of jQuery secrets presented by Bastian Feder. It discusses various techniques including saving and removing state from DOM elements using jQuery.data() and jQuery.removeData(), extending jQuery functionality through plugins, and customizing AJAX requests and event handling. The presentation provides code examples for working with jQuery's data storage methods, namespaces, promises/deferreds, global AJAX settings, and extending jQuery.
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
28 slides422 views
Javascript unit testing, yes we can e big by Andy Peterson, has 35 slides with 1098 views.This document discusses test-driven development for JavaScript using ScrewUnit and BlueRidge. It introduces the Carbon Five consulting firm and covers why JavaScript unit testing is important. It then demonstrates how to write behavioral tests using ScrewUnit's BDD style and shows a live example testing a wizard component. Some challenges of JavaScript testing like DOM cleanup and structure are addressed. The document emphasizes that JavaScript testing is possible and can be integrated into the development process.
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
35 slides1.1K views
#NewMeetup Performance by Justin Cataldo, has 70 slides with 556 views.This document discusses optimizing Meetup's performance by reducing page load times. It recommends reducing JavaScript, image, DOM, and CSS files. Specific techniques include externalizing and concatenating JavaScript, lazy loading images and scripts, minimizing DOM elements, writing efficient CSS selectors, and profiling code to optimize loops and DOM manipulation. Reducing page weight through these techniques can improve the user experience by speeding up load times and drop in member activity.
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
Justin Cataldo
70 slides556 views
Beyond DOMReady: Ultra High-Performance Javascript by aglemann, has 139 slides with 2746 views.Leverage patterns of large-scale JS – such as modules, publish-subscribe and delegation – to achieve extreme performance without sacrificing maintainability.
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascript
aglemann
139 slides2.7K views
Javascript in Plone by Steve McMahon, has 72 slides with 2237 views.This document provides an overview of what JavaScript capabilities are available in Plone and how to use them. It discusses nuts and bolts topics like injecting JavaScript and CSS, as well as how to create common interactive elements like validation, popups, tabs, and drag and drop functionality using tools like jQuery. The document is intended as an introduction for Plone developers on getting started with JavaScript in Plone.
Javascript in PloneJavascript in Plone
Javascript in Plone
Steve McMahon
72 slides2.2K views
jQuery Basic API by Hyeonseok Shin, has 98 slides with 1341 views.The document discusses jQuery, a JavaScript library. It provides an introduction to jQuery, explaining that it simplifies HTML document traversal and manipulation, event handling, animation, and Ajax interactions for rapid web development. It also allows developers to write less code and do more. The core jQuery function and chaining methods are described. Finally, it covers jQuery selectors, traversing, manipulation, and other basic APIs.
jQuery Basic APIjQuery Basic API
jQuery Basic API
Hyeonseok Shin
98 slides1.3K views
jQuery Best Practice by chandrashekher786, has 20 slides with 659 views.This document provides best practices for using jQuery, including loading jQuery from a CDN, using variables to cache jQuery objects, optimizing selectors for performance, best practices for DOM manipulation, event handling, AJAX requests, animations, chaining, using plugins, and other miscellaneous tips. Key recommendations include prefixing variables with $, using ID selectors when possible, giving selectors context, avoiding implied universal selectors, detaching elements before manipulation, avoiding anonymous event handlers, and using object literals for parameters.
jQuery Best Practice jQuery Best Practice
jQuery Best Practice
chandrashekher786
20 slides659 views
DOM Scripting Toolkit - jQuery by Remy Sharp, has 44 slides with 3418 views.The document discusses jQuery, a JavaScript library that makes DOM scripting and Ajax requests easier. It provides functions to select elements, handle events, animate elements and load JSON data. Some key features include CSS selector syntax, DOM manipulation methods, event handling and Ajax functions. The document also covers plugins, effects, and utilities included in jQuery.
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
Remy Sharp
44 slides3.4K views
Frontin like-a-backer by Frank de Jonge, has 91 slides with 10578 views.The document discusses the evolution of the author's views on JavaScript and front-end frameworks. It begins by expressing dislike for JavaScript but acknowledging the need for it. Various frameworks like Backbone, Angular, and Ember are explored but found lacking. React is then introduced and praised for its declarative and composable approach similar to HTML. The author comes to understand JSX and how React implements unidirectional data flow to separate the UI from data logic. This allows building full-stack applications with React handling both client and server rendering based on shared intentions, state, and data flow patterns.
Frontin like-a-backerFrontin like-a-backer
Frontin like-a-backer
Frank de Jonge
91 slides10.6K views
Ember background basics by Philipp Fehre, has 46 slides with 3097 views.This document provides an introduction to Ember.js and discusses some of its core concepts and patterns. It explains that Ember uses an observer pattern where objects called observables maintain lists of dependent observer objects that are notified of state changes. It also discusses how Ember implements an asynchronous run loop and single source of truth model layer for data binding and decoupling different parts of the application.
Ember background basicsEmber background basics
Ember background basics
Philipp Fehre
46 slides3.1K views
J query training by FIS - Fidelity Information Services, has 33 slides with 440 views.This document provides an overview of jQuery, including what it is, why it's useful, how to get started, and some common jQuery syntax. jQuery is a JavaScript library that makes it much easier to use JavaScript on websites. It simplifies tasks like DOM manipulation, event handling, animation, and Ajax. The document explains how to download jQuery, includes some basic jQuery syntax using selectors and methods, and covers various features like effects, HTML/CSS manipulation, events, traversing, and Ajax.
J query trainingJ query training
J query training
FIS - Fidelity Information Services
33 slides440 views
Jarv.us Showcase — SenchaCon 2011 by Chris Alfano, has 85 slides with 357 views.The document provides an overview and code snippets for an Eagles 2011 NFL Draft mobile app created with Sencha Touch. It discusses challenges faced like learning Sencha Touch, displaying live updates, and adapting images for different screen sizes. Lessons learned include destroying DOM elements when done, establishing post-launch content parameters, and using background-size for images. The document also discusses tooling, dependencies, and best practices for mobile development.
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
Chris Alfano
85 slides357 views
The Best (and Worst) of Django by Jacob Kaplan-Moss, has 53 slides with 36416 views.The document discusses best practices and anti-patterns for Django projects. It recommends keeping projects simple by avoiding over-engineering, using application-based modular design, and properly structuring settings files across multiple environments rather than relying on local_settings.py files. It also addresses common issues like import errors caused by PYTHONPATH configuration.
The Best (and Worst) of DjangoThe Best (and Worst) of Django
The Best (and Worst) of Django
Jacob Kaplan-Moss
53 slides36.4K views
jQuery Foot-Gun Features by dmethvin, has 51 slides with 993 views.This talk recaps some features and practices that are best to avoid in good jQuery pages and apps. Following these rules will improve performance and maintainability, and may prevent your co-workers from coming after you with sharp objects.
jQuery Foot-Gun FeaturesjQuery Foot-Gun Features
jQuery Foot-Gun Features
dmethvin
51 slides993 views

More from Paul Irish (8)

Progressive Advancement, by way of progressive enhancement by Paul Irish, has 40 slides with 2164 views.The document discusses progressive enhancement and feature detection using Modernizr. It emphasizes starting with modern capabilities like HTML5 and CSS3, while providing graceful fallback for older browsers. Modernizr helps detect features to conditionally apply native and polyfill code, improving performance for all browsers. The presentation encourages teams to adopt progressive enhancement and performance best practices.
Progressive Advancement, by way of progressive enhancementProgressive Advancement, by way of progressive enhancement
Progressive Advancement, by way of progressive enhancement
Paul Irish
40 slides2.2K views
webfonts & @font-face :: in brief by Paul Irish, has 28 slides with 11369 views.This document discusses using webfonts with @font-face and browser support. It provides a chart showing browser support for @font-face dating back to IE5. Over 97% of browsers support @font-face. Free fonts can be acquired from sites like Fontsquirrel and commercial fonts from services like Typekit. The Font Squirrel generator and FontSpring are tools that can be used to convert fonts for @font-face usage.
webfonts & @font-face :: in briefwebfonts & @font-face :: in brief
webfonts & @font-face :: in brief
Paul Irish
28 slides11.4K views
Progressive Advancement in Web8 by Paul Irish, has 38 slides with 1392 views.You can put html5 and css3 to use *today*. Using some clever code and trusted techniques of progressive enhancement, you'll be creating cutting edge sites that handle older browsers appropriately.
Progressive Advancement in Web8Progressive Advancement in Web8
Progressive Advancement in Web8
Paul Irish
38 slides1.4K views
Squeezing The Best Out Of Webfonts by Paul Irish, has 103 slides with 12100 views.This document discusses different techniques for using webfonts, including JavaScript-based font solutions like SIFR, Typeface.js, Cufon, and Facelift. It provides an overview of each solution, including their configuration, runtime techniques, browser support, licensing issues, and performance. The document also covers using the @font-face rule, browser support for @font-face and SVG fonts, licensing considerations, and webfont services like Typekit, Typotheque, Kernest, and Fontdeck. It provides advice on acquiring fonts, picking the right font, and techniques for implementing webfonts yourself.
Squeezing The Best Out Of WebfontsSqueezing The Best Out Of Webfonts
Squeezing The Best Out Of Webfonts
Paul Irish
103 slides12.1K views
Modernizr - Detecting HTML5 and CSS3 support by Paul Irish, has 15 slides with 1567 views.The document discusses using Modernizr to provide progressive enhancement for HTML5 and CSS3 features. It lists many new features in HTML5 and CSS3 like rounded corners, transformations, gradients, etc. It explains that Modernizr allows using tomorrow's technologies today through feature detection, and will apply native implementations if supported or fallback options if not. It positions Modernizr as a way to get coverage for all the new HTML5 and CSS3 features, in an open source library that can be forked on GitHub.
Modernizr - Detecting HTML5 and CSS3 supportModernizr - Detecting HTML5 and CSS3 support
Modernizr - Detecting HTML5 and CSS3 support
Paul Irish
15 slides1.6K views
Employing Custom Fonts by Paul Irish, has 63 slides with 5228 views.This document summarizes different techniques for employing custom fonts on websites, including @font-face embedding, font services like Typekit, and rich text replacement libraries like sIFR. It discusses topics like font formats, browser support, licensing, and techniques for protecting font files. Key points covered include browser support for @font-face, various font-as-a-service providers and their approaches, and how rich text libraries like sIFR and Typeface.js transform text into images or vectors on the fly.
Employing Custom FontsEmploying Custom Fonts
Employing Custom Fonts
Paul Irish
63 slides5.2K views
Practical Design Solutions from Japan by Paul Irish, has 20 slides with 923 views.A talk I gave at Pecha Kucha Worcester. June 2009.
Practical Design Solutions from JapanPractical Design Solutions from Japan
Practical Design Solutions from Japan
Paul Irish
20 slides923 views
Rich Typography Options For The Web - or - Why sIFR is Dead in 2009 by Paul Irish, has 57 slides with 3255 views.This document compares different techniques for embedding rich typography on web pages, including sIFR, Facelift, Typeface.js, and Cufon. sIFR uses Flash but has issues with non-Latin characters and performance. Facelift is safer for font licensing but has slower performance due to its use of images. Typeface.js has bugs and an inactive developer. Cufon has the best performance and an active community. In conclusion, Cufon is the best current option for rich web typography.
Rich Typography Options For The Web - or - Why sIFR is Dead in 2009Rich Typography Options For The Web - or - Why sIFR is Dead in 2009
Rich Typography Options For The Web - or - Why sIFR is Dead in 2009
Paul Irish
57 slides3.3K views

Recently uploaded (20)

Introduction to Mobile App Development. by AkashDwivedi43, has 8 slides with 30 views.Mobile app development is a fundamental element of today’s digital landscape. It is transforming various industries like healthcare, e-commerce, entertainment, and education. As the use of mobile devices continues to soar, businesses are turning to mobile apps to boost customer engagement, offer innovative services, and deliver personalized experiences. Whether it’s enhancing customer service or introducing new tools, mobile apps help businesses stay connected to users in meaningful ways. For businesses, mobile apps provide a direct and efficient method of communication with customers. With real-time, personalized interactions, apps can enhance user engagement, foster customer loyalty, and increase sales. Additionally, mobile apps offer businesses the flexibility to streamline processes, deliver new services, and cater to customer demands in today’s mobile-first world. They are essential for companies seeking to stay competitive and relevant. For developers, mobile app development presents both challenges and opportunities. It requires a deep understanding of user needs, creative design skills, and technical expertise in coding and testing. A successful app must be user-friendly, reliable, and innovative. Developers need to balance functionality and design, ensuring that apps perform seamlessly across different devices and operating systems. Successful apps often feature unique capabilities or solve specific problems. The goal is to create an intuitive and engaging experience, whether it’s simplifying everyday tasks, providing entertainment, or offering educational content. A well-designed app not only attracts users but keeps them returning by delivering real value and solving their problems. Mobile apps also enable businesses to gather valuable user data, which can be used to improve marketing strategies, refine products, and enhance customer support. Understanding user behavior and preferences helps businesses optimize the app experience, boosting customer satisfaction. Furthermore, mobile apps present businesses with new revenue streams, such as in-app purchases, subscriptions, and ads. For startups, apps are an affordable way to test ideas and reach new customers, while larger companies can use apps to improve operational efficiency, increase customer loyalty, and stay ahead of competitors. Whether you're a small business or a large corporation, mobile apps offer tremendous potential. By focusing on providing a seamless user experience, ensuring app functionality and delivering regular updates, businesses can enhance customer relationships and remain competitive in the crowded app market. For developers, mobile app development offers a world of possibilities. With emerging technologies like AI, AR, and IoT, the future of app development is full of exciting opportunities. As the demand for mobile apps continues to grow, developers have a chance to shape the future of digital interaction and positively impact millions of users worldwid.
Introduction to  Mobile App Development.Introduction to  Mobile App Development.
Introduction to Mobile App Development.
AkashDwivedi43
8 slides30 views
Artificial Neural Networks, basics, its variations and examples by anandsimple, has 95 slides with 127 views.The slides describe basics of Artificial Neural Networks, its variations and examples in details.
Artificial Neural Networks, basics, its variations and examplesArtificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examples
anandsimple
95 slides127 views
APAC Solutions Challenge Info Session.pdf by GDG on Campus Monash, has 50 slides with 139 views.GDG on Campus Monash hosted Info Session to provide details of the Solution Challenge to promote participation and hosted networking activities to help participants find their dream team
APAC Solutions Challenge Info Session.pdfAPAC Solutions Challenge Info Session.pdf
APAC Solutions Challenge Info Session.pdf
GDG on Campus Monash
50 slides139 views
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryData by BookNet Canada, has 25 slides with 95 views.Lily Dwyer updates us on what 2024 brought for SalesData and LibraryData. Learn about new features, such as the Age Range data and Page Count data filters, improvements to our internal Admin tool, and what’s in store for 2025. Link to video and transcript: https://bnctechforum.ca/sessions/new-from-booknet-canada-for-2025-bnc-salesdata-and-bnc-librarydata/ Read more: - https://www.booknetcanada.ca/salesdata - https://booknetcanada.atlassian.net/wiki/spaces/UserDocs/pages/53707258/SalesData+Help+Manual Presented by BookNet Canada on April 8, 2025 with support from the Department of Canadian Heritage.
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryDataNew from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
BookNet Canada
25 slides95 views
Q1 FY26 TUG Leader Quarterly Call - APAC / EMEA by lward7, has 21 slides with 29 views.EMEA/APAC Friendly call
Q1 FY26 TUG Leader Quarterly Call - APAC / EMEAQ1 FY26 TUG Leader Quarterly Call - APAC / EMEA
Q1 FY26 TUG Leader Quarterly Call - APAC / EMEA
lward7
21 slides29 views
How to Achieve High-Accuracy Results When Using LLMs by Aggregage, has 31 slides with 75 views.Ben Epstein, Stealth Founder & CTO, is here to share how he and his team engineered a system that employs reproducible test variations and enables non-LLM evaluation metrics for at-scale production guardrails. This walk-through will provide practical, battle-tested techniques you can immediately apply to your own LLM-powered SaaS solutions!
How to Achieve High-Accuracy Results When Using LLMsHow to Achieve High-Accuracy Results When Using LLMs
How to Achieve High-Accuracy Results When Using LLMs
Aggregage
31 slides75 views
Top 10 Mobile Hacking Tools – 2025 Edition by anishachhikara2122, has 18 slides with 12 views.Explore the most powerful and widely-used mobile hacking tools in cybersecurity today. This presentation covers top tools like MobSF, Frida, Hopper, Ghidra, Objection, and more—highlighting their core features, use cases, platforms, and practical tips. Whether you're a security researcher, ethical hacker, or mobile app developer, this slide deck offers a well-rounded introduction to both static and dynamic analysis tools for Android and iOS. Ideal for training, awareness, and professional development.
Top 10 Mobile Hacking Tools – 2025 EditionTop 10 Mobile Hacking Tools – 2025 Edition
Top 10 Mobile Hacking Tools – 2025 Edition
anishachhikara2122
18 slides12 views
CitrineOS: Bridging the Past and Future of EV Charging with OCPP 1.6 & 2.x Su... by DanBrown980551, has 15 slides with 65 views.Join us for an exclusive webinar showcasing the latest advancements in CitrineOS, the open-source, API-first Charge Station Management System. With expanded support for OCPP 1.6 alongside full OCPP 2.x compatibility, CitrineOS is now more adaptable than ever—allowing operators to seamlessly manage both legacy and next-generation EV chargers. Discover how our new dynamic UI enhances operational efficiency, providing native EV charging network management with intuitive TimeSeries data views for authorizations, transactions, charging stations, and locations. Learn about technical upgrades, including the addition of GraphQL, improved file storage flexibility, and a refactored core designed to support multiple OCPP protocols. Don’t miss this opportunity to see how CitrineOS is redefining charge station management with a future-proof platform that evolves with the industry. Register now to stay ahead in the rapidly changing EV charging landscape!
CitrineOS: Bridging the Past and Future of EV Charging with OCPP 1.6 & 2.x Su...CitrineOS: Bridging the Past and Future of EV Charging with OCPP 1.6 & 2.x Su...
CitrineOS: Bridging the Past and Future of EV Charging with OCPP 1.6 & 2.x Su...
DanBrown980551
15 slides65 views
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship by TrustArc, has 12 slides with 145 views.In today’s digital age, data has become an organization’s lifeblood. As the use of digital technologies continues to escalate, so do the risks associated with personal data, which continue to grow exponentially as well. To effectively safeguard personal and sensitive information, organizations must understand the intricate relationship between data privacy, cybersecurity, and incident response. Data privacy and cybersecurity are two sides of the same coin. Data privacy focuses on how personal data is to be collected, used, stored, shared and controlled, while cybersecurity aims to protect systems and networks from unauthorized access, digital attacks, malware and data breaches. However, even with the best data privacy and security measures in place, cyber incidents can still occur. A well-prepared incident response plan is crucial for minimizing the impact of a breach and restoring normal operations. Join our experts on this webinar to discuss how data privacy, cybersecurity, and incident response interact and are essential for safeguarding your organization’s digital assets. This webinar will review: - How data privacy and cybersecurity intersect - How to develop a comprehensive privacy and security strategy to safeguard personal and sensitive information - What are suggestions and expectations around incident response
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic RelationshipTrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship
TrustArc
12 slides145 views
Cybersecurity-Threat-Landscape-March-31-April-7-2025.pdf by Joe Shenouda, has 10 slides with 82 views.Weekly cyber hits: NK hackers drop BeaverTail via 11 npm pkgs (5.6k dl’s) targeting devs. Ivanti flaw (CVE-2025-22457) hit by China pros—patch by 4/11! PoisonSeed spams Coinbase; PyPI pkgs (39k dl’s) swipe data. Lock it down! Like & share for more!
Cybersecurity-Threat-Landscape-March-31-April-7-2025.pdfCybersecurity-Threat-Landscape-March-31-April-7-2025.pdf
Cybersecurity-Threat-Landscape-March-31-April-7-2025.pdf
Joe Shenouda
10 slides82 views
Introduction to PHP from Beginning to End by christopherneo4, has 53 slides with 27 views.Introduction to PHP Tutorial
Introduction to PHP from Beginning to EndIntroduction to PHP from Beginning to End
Introduction to PHP from Beginning to End
christopherneo4
53 slides27 views
AC2-Agile-Agile concepts in an enterprise environment by Dennis Van Aelst, has 22 slides with 14 views.what is Agile? Agile concepts in an enterprise environment_agile
AC2-Agile-Agile concepts in an enterprise environmentAC2-Agile-Agile concepts in an enterprise environment
AC2-Agile-Agile concepts in an enterprise environment
Dennis Van Aelst
22 slides14 views
TNBC Research Presentation and medical virology .pptx by MohamedHasan816582, has 55 slides with 12 views.TNBC Research Presentation and medical virology .pptx
TNBC Research Presentation and medical virology .pptxTNBC Research Presentation and medical virology .pptx
TNBC Research Presentation and medical virology .pptx
MohamedHasan816582
55 slides12 views
Codequiry: A Code Similarity Checker Every Developer Should Know by Code Quiry, has 7 slides with 39 views.Every developer values originality—and Codequiry makes it easy to protect it. This powerful code similarity checker analyzes structure, logic, and syntax to detect plagiarism with precision. With support for 50+ programming languages and in-depth comparison across web, peer, and internal sources, Codequiry is an essential tool for anyone serious about writing clean, authentic, and uncompromised code.
Codequiry: A Code Similarity Checker Every Developer Should KnowCodequiry: A Code Similarity Checker Every Developer Should Know
Codequiry: A Code Similarity Checker Every Developer Should Know
Code Quiry
7 slides39 views
AI in SEO Marketing Presentation (BY MetaSense Marketing) by MetaSenseMarketing, has 11 slides with 15 views.AI in SEO Marketing PPT
AI in SEO Marketing Presentation (BY MetaSense Marketing)AI in SEO Marketing Presentation (BY MetaSense Marketing)
AI in SEO Marketing Presentation (BY MetaSense Marketing)
MetaSenseMarketing
11 slides15 views
Introduction to Generative AI refers to a subset of artificial intelligence by Kongu Engineering College, Perundurai, Erode, has 109 slides with 30 views.Generative AI refers to a subset of artificial intelligence that focuses on creating new content, such as images, text, music, and even videos, based on the data it has been trained on. Generative AI models learn patterns from large datasets and use these patterns to generate new content.
Introduction to Generative AI refers to a subset of artificial intelligenceIntroduction to Generative AI refers to a subset of artificial intelligence
Introduction to Generative AI refers to a subset of artificial intelligence
Kongu Engineering College, Perundurai, Erode
109 slides30 views
Transactional Outbox & Inbox Patterns.pptx by Maysam Mousa, has 19 slides with 84 views.This presentation provides a comprehensive overview of the Transactional Outbox Pattern and the Inbox Pattern, two essential techniques for ensuring reliable and consistent communication in distributed systems. We start by clearly outlining the problem these patterns aim to solve—namely, maintaining data consistency between databases and message brokers in event-driven architectures. From there, we delve into what the Outbox Pattern is, how it works under the hood, and how it guarantees message delivery even in the face of failures. The presentation then shifts focus to the Inbox Pattern, explaining its role in ensuring idempotency and preventing duplicate processing of messages. Each concept is explained with simple language, diagrams, and a logical flow that builds a solid understanding from the ground up. Whether you’re an engineer building microservices or just exploring distributed system patterns, this talk provides clarity, practical insights, and a helpful demo to see the patterns in action. Topics Covered: * Problem Statement * Transactional Outbox Pattern * How It Solves the Problem * Internal Mechanics * Delivery Guarantees * Inbox Pattern Explained * Internal Workflow * Conclusions & Further Reading * Demo
Transactional Outbox & Inbox Patterns.pptxTransactional Outbox & Inbox Patterns.pptx
Transactional Outbox & Inbox Patterns.pptx
Maysam Mousa
19 slides84 views
Ricardo Jebb Bruno - A Structural CAD Technician by Ricardo Jebb Bruno, has 7 slides with 44 views.Ricardo Jebb Bruno is a skilled Structural CAD Technician with over 10 years of experience. He specializes in structural analysis, design, and project management, and is proficient in AutoCAD, Revit, and SolidWorks. A graduate of the University of Miami with a degree in Civil Engineering, he currently works at Metrix Structural Group. Ricardo is a member of the American Society of Civil Engineers and the National CAD Society, and volunteers with Habitat for Humanity. His hobbies include 3D printing and sci-fi media.
Ricardo Jebb Bruno - A Structural CAD TechnicianRicardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno - A Structural CAD Technician
Ricardo Jebb Bruno
7 slides44 views
Threat Modeling a Batch Job System - AWS Security Community Day by Teri Radichel, has 57 slides with 261 views.I've been working on building a batch job framework for a few years now and blogging about it in the process. This presentation explains how and why I started building and writing about this system and the reason it changed from deploying one simple batch job to a much bigger project. I explore a number of recent data breaches, how they occurred, and what may have prevented them along the way. We consider how what make goes into an effective security architecture and well-designed security controls that avoid common pitfalls. There are friend links to many blog posts in the notes of the presentation that bypass the paywall. Topics include security architecture, IAM, encryption (KMS), networking, MFA, source control, separation of duties, supply chain attacks, and more.
Threat Modeling a Batch Job System - AWS Security Community DayThreat Modeling a Batch Job System - AWS Security Community Day
Threat Modeling a Batch Job System - AWS Security Community Day
Teri Radichel
57 slides261 views
CEE Software Development M&A Report 2025 by Yevgen Sysoyev, has 42 slides with 37 views.Comprehensive coverage of M&A activity in Software Development (IT Outsourcing) industry in CEE region since 2022
CEE Software Development M&A Report 2025CEE Software Development M&A Report 2025
CEE Software Development M&A Report 2025
Yevgen Sysoyev
42 slides37 views
Introduction to Mobile App Development. by AkashDwivedi43, has 8 slides with 30 views.Mobile app development is a fundamental element of today’s digital landscape. It is transforming various industries like healthcare, e-commerce, entertainment, and education. As the use of mobile devices continues to soar, businesses are turning to mobile apps to boost customer engagement, offer innovative services, and deliver personalized experiences. Whether it’s enhancing customer service or introducing new tools, mobile apps help businesses stay connected to users in meaningful ways. For businesses, mobile apps provide a direct and efficient method of communication with customers. With real-time, personalized interactions, apps can enhance user engagement, foster customer loyalty, and increase sales. Additionally, mobile apps offer businesses the flexibility to streamline processes, deliver new services, and cater to customer demands in today’s mobile-first world. They are essential for companies seeking to stay competitive and relevant. For developers, mobile app development presents both challenges and opportunities. It requires a deep understanding of user needs, creative design skills, and technical expertise in coding and testing. A successful app must be user-friendly, reliable, and innovative. Developers need to balance functionality and design, ensuring that apps perform seamlessly across different devices and operating systems. Successful apps often feature unique capabilities or solve specific problems. The goal is to create an intuitive and engaging experience, whether it’s simplifying everyday tasks, providing entertainment, or offering educational content. A well-designed app not only attracts users but keeps them returning by delivering real value and solving their problems. Mobile apps also enable businesses to gather valuable user data, which can be used to improve marketing strategies, refine products, and enhance customer support. Understanding user behavior and preferences helps businesses optimize the app experience, boosting customer satisfaction. Furthermore, mobile apps present businesses with new revenue streams, such as in-app purchases, subscriptions, and ads. For startups, apps are an affordable way to test ideas and reach new customers, while larger companies can use apps to improve operational efficiency, increase customer loyalty, and stay ahead of competitors. Whether you're a small business or a large corporation, mobile apps offer tremendous potential. By focusing on providing a seamless user experience, ensuring app functionality and delivering regular updates, businesses can enhance customer relationships and remain competitive in the crowded app market. For developers, mobile app development offers a world of possibilities. With emerging technologies like AI, AR, and IoT, the future of app development is full of exciting opportunities. As the demand for mobile apps continues to grow, developers have a chance to shape the future of digital interaction and positively impact millions of users worldwid.
Introduction to  Mobile App Development.Introduction to  Mobile App Development.
Introduction to Mobile App Development.
AkashDwivedi43
8 slides30 views
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship by TrustArc, has 12 slides with 145 views.In today’s digital age, data has become an organization’s lifeblood. As the use of digital technologies continues to escalate, so do the risks associated with personal data, which continue to grow exponentially as well. To effectively safeguard personal and sensitive information, organizations must understand the intricate relationship between data privacy, cybersecurity, and incident response. Data privacy and cybersecurity are two sides of the same coin. Data privacy focuses on how personal data is to be collected, used, stored, shared and controlled, while cybersecurity aims to protect systems and networks from unauthorized access, digital attacks, malware and data breaches. However, even with the best data privacy and security measures in place, cyber incidents can still occur. A well-prepared incident response plan is crucial for minimizing the impact of a breach and restoring normal operations. Join our experts on this webinar to discuss how data privacy, cybersecurity, and incident response interact and are essential for safeguarding your organization’s digital assets. This webinar will review: - How data privacy and cybersecurity intersect - How to develop a comprehensive privacy and security strategy to safeguard personal and sensitive information - What are suggestions and expectations around incident response
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic RelationshipTrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship
TrustArc
12 slides145 views

jQuery Anti-Patterns for Performance & Compression

  • 1. jQuery Anti-Patterns for Performance & Compression Paul Irish NC JavaScript Camp ’10
  • 2. jQuery Anti-Patterns for Performance & Compression Paul Irish NC JavaScript Camp ’10
  • 3. Me. Interaction Designer at Molecular, Inc. jQuery Team Member - Dev. Relations @paul_irish http://paulirish.com Front-end development blog http://aurgasm.us Eclectic music blog
  • 4. Performance
  • 5. Performance
  • 6. wassup shawty? how u doin’ Taskspeed Test Lines of Code 200 150 100 50 0 YUI Dojo 1.3.1 Dojo 1.2.3 Qooxdoo MooTools Prototype.js jQuery PureDOM
  • 7. Oft cited best practices Cache length during loops Cache your selections Leverage documentFragment Append new content outside the loop
  • 8. Oft cited best practices Cache length during loops // appending inside. bad. $.each(reallyLongArray, function(count, item) { Cache your selections var newLI = '<li>' + item + '</li>'; $('#ballers').append(newLI); Leverage documentFragment }); Append new content outside the loop // documentFragment off-DOM var frag = document.createDocumentFragment(); $.each(reallyLongArray, function(count, item) { var newLI = '<li>' + item + '</li>'; frag.appendChild(newLI[0]); }); $('#ballers')[0].appendChild(frag);
  • 9. var newLI = '<li>' + item + '</li>'; $('#ballers').append(newLI); Oft cited best practices }); // documentFragment off-DOM var frag = document.createDocumentFragment(); Cache length during loops $.each(reallyLongArray, function(count, item) { var newLI = '<li>' + item + '</li>'; Cache your selections frag.appendChild(newLI[0]); }); Leverage documentFragment $('#ballers')[0].appendChild(frag); Append new content outside the loop // string concatenate and set innerHTML var myhtml = ''; $.each(reallyLongArray, function(count, item) { myhtml += '<li>' + item + '</li>'; }); $('#ballers').html(myhtml);
  • 10. Keep things DRY If you’re repeating yourself, you’re doing it wrong
  • 11. Moar DRY plz? if ($ventfade.data('currently') != 'showing') { $ventfade.stop(); } if ($venthover.data('currently') != 'showing') { $venthover.stop(); } if ($spans.data('currently') != 'showing') { $spans.stop(); } from http://mt-ventures.com/_js/global.js
  • 12. All clean! Thx var elems = [$ventfade,$venthover,$spans]; $.each(elems,function(k,v){ if (v.data('currently') != 'showing'){ v.stop(); } })
  • 13. Architecture Anti-Patterns Anonymous functions bound everywhere suck $(document).ready(function(){ ... $('#magic').click(function(e){ $('#yayeffects').slideUp(function(){ ... }); }); $('#happiness').load(url+' #unicorns',function(){ ... }) });
  • 14. Architecture - Object Literal var PI = { onReady : function(){ ... $('#magic').click(PI.candyMtn); $('#happiness').load(url+' #unicorns',PI.unicornCb); }, candyMtn : function(e){ $('#yayeffects').slideUp(PI.slideCb); }, slideCb : function(){ ... }, unicornCb : function(){ ... } } $(document).ready(PI.onReady);
  • 15. Architecture - Object Literal Advantages: Easier to navigate and discuss Profilers give you actual names to work with You can execute these from firebug console You can write unit tests against them
  • 16. Anti-Pattern: The requery // create and append your element $(document.body).append("<div class='baaron'/>"); // requery to bind stuff $("div.baaron").click(function(){}); // better: // swap to appendTo to hold your elem $("<div class='baaron'/>") .appendTo(document.body) .click(function(){});
  • 17. $(‘#whats .the’,context)
  • 18. This is not the .context property // find all stylesheets in the body var bodySheets = $('style',document.body); bodySheets.context // ==> BODY element Ignore that for the moment, I know no one that’s found a use
  • 19. $(‘#whats .the’,context) Never pass it a selector string. Ever. No performance gain vs $(root).find(selector) var arms = $('div.robotarm', '#container'); // instead do: var arms = $('#container').find('div.robotarm');

Editor's Notes

  • #2: update the taskspeed shit. delegation facts.
  • #3: i hang in #jquery so a lot of examples are from real code discussed there.
  • #8: like copypasting a line or three of code
  • #12: rebecca murphey will be discussing this technique a lot more
  • #18: the convenience of context will incur the cost of three extra if() statements in jQuery.fn.init()
  • #20: selectors. ugh.
  • #21: did it because i wanted to study. the old ones are probablyw ayyyyy easier to study as the new ones use some crazy techniques
  • #22: did it because i wanted to study. the old ones are probablyw ayyyyy easier to study as the new ones use some crazy techniques
  • #24: before sizzle it was LTR. sizzle changed it.
  • #25: before sizzle it was LTR. sizzle changed it.
  • #26: before sizzle it was LTR. sizzle changed it.
  • #27: be brief on the left the more you can filter down the righthandmost expression, the faster it will run.
  • #28: id is grabbed. optimization
  • #29: in my testing it didnt speed up basic selecting.
  • #31: css engine too.
  • #33: TDs and LI&amp;#x2019;s etccc
  • #38: document.body as an append target is WIN
  • #41: padolsey&amp;#x2019;s research on animate()
  • #51: strings take up a lot of space, so allowing them to be munged helps a lot compress it and look for repetition
  • #57: DRY obviously
  • #58: DRY obviously
  • #60: really understand truthy and falsy ness