martes, 13 de diciembre de 2016

Front-end performance improvements

Defer loading of javascript

This code should be placed in your HTML just before the </body> tag (near the bottom of your HTML file). I highlighted the name of the external JS file.
<script type="text/javascript">
 function downloadJSAtOnload() {
  var element = document.createElement("script");
  element.src = "defer.js";
  document.body.appendChild(element);
 }
 if (window.addEventListener)
  window.addEventListener("load", downloadJSAtOnload, false);
 else if (window.attachEvent)
  window.attachEvent("onload", downloadJSAtOnload);
 else window.onload = downloadJSAtOnload;
</script>
Reference: https://varvy.com/pagespeed/defer-loading-javascript.html

Loading Javascript Asynchronously

Async allows the script to be downloaded in the background without blocking. Then, the moment it finishes downloading, rendering is blocked and that script executes. Render resumes when the script has executed.
<script async src="foobar.js"></script>
Reference: https://www.keycdn.com/blog/blocking-the-dom/

XHR Eval

In this technique, an XMLHttpRequest (XHR) retrieves the JavaScript from the server. When the response is complete, the content is executed using the eval command.
var xhrObj = getXHRObject();
xhrObj.onreadystatechange =
    function() {
        if ( xhrObj.readyState == 4 && 200 == xhrObj.status ) {
            eval(xhrObj.responseText);
        }
    };
xhrObj.open('GET', 'A.js', true); // must be same domain as main page
xhrObj.send('');

function getXHRObject() {
    var xhrObj = false;
    try {
        xhrObj = new XMLHttpRequest();
    }
    catch(e){
        var progid = ['MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0',
'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];
        for ( var i=0; i < progid.length; ++i ) {
            try {
                xhrObj = new ActiveXObject(progid[i]);
            }
            catch(e) {
                continue;
            }
            break;
        }
    }
    finally {
        return xhrObj;
    }
}

XHR Injection

Like XHR Eval, the XHR Injection technique uses an XMLHttpRequest to retrieve the JavaScript. But instead of using eval, the JavaScript is executed by creating a script DOM element and injecting the XMLHttpRequest response into the script.
var xhrObj = getXHRObject(); // defined in the previous example
xhrObj.onreadystatechange =
    function() {
        if ( xhrObj.readyState == 4 ) {
            var scriptElem = document.createElement('script');
            document.getElementsByTagName('head')[0].appendChild(scriptElem);
            scriptElem.text = xhrObj.responseText;
        }
    };
xhrObj.open('GET', 'A.js', true); // must be same domain as main page
xhrObj.send('');
Reference: https://www.safaribooksonline.com/library/view/even-faster-web/9780596803773/ch04.html

Script in Iframe

Iframes are loaded in parallel with other components in the main page. Whereas iframes are typically used to include one HTML page within another, the Script in Iframe technique leverages them to load JavaScript without blocking.

Non-Render Blocking CSS

If you are going for completely non-render blocking CSS then you really only have one good option, and that is to inline your CSS.

Other references


  1. Render blocking javascripts
    https://varvy.com/pagespeed/render-blocking.html
  2. Perceived Web Performance – What is Blocking the DOM?
    https://www.keycdn.com/blog/blocking-the-dom/



martes, 29 de noviembre de 2016

Story "dragging"

Problem
A feature isn't necessarily implemented 100% in one sprint (e.g. because it's still in QA and thus, not yet "done"). So if e.g. 90% of the work for one feature has been done in one sprint, it is not reflected in the burndown chart, since the respective feature is still not set to "done".
Discussion
Stories "dragging" through means they are too large for a single sprint, and should be decomposed further. Counting partial points, or re-estimating afterwards would only hide that issue, hurting the team long term.

So if your team targets 40 points each sprint, and the 8 point story is NOT completed this sprint, the team only delivers 32 points. But next sprint this large story will be completed quickly, allowing the team to actually meet their 40 point commitment, AND pull another story into the sprint delivering ~48 points. The average of the two sprints is still 40, and the velocity remains true.

References

Velocity


Velocity is measure of long term planning .

A classic example is this- suppose a team averages 85 points a game so far this season (lets say 10 games played). It is safe to say they will average 85 points over the next 5 games, but NOT safe to say they will score exactly 85 points next game. They could score 70, 100, or anything else.

jueves, 24 de noviembre de 2016

Column constraints

Setting Column Constraints


Setting constraints on each workflow state is a crucial part of Kanban (although you can use it in sprint board too), so that you can ensure that work is continually flowing through the pipeline. You may also find it handy in Scrum, so that you can see bottlenecks early, and adjust the scope of your sprint.

Constraints trigger a visual indicator when a maximum or minimum number of issues appear in a column. You can specify constraints for all columns, or just some of them. If a column constraint is exceeded, then the column will change color, as follows:
  • Column colored red — Maximum number of issues exceeded
  • Column colored yellow — Minimum number of issues not met
Please note:
  • The values of the column constraints will appear at the top of each column you set them for. These values don't have any impact on the number of issues displayed in the columns.
  • Column constraints apply to the total number of issues in a column, regardless of whether issues are hidden by a Quick Filter.

miércoles, 23 de noviembre de 2016

Hooks

A hook is a PHP function that is named foo_bar(), where "foo" is the name of the module (whose filename is thus foo.module) and "bar" is the name of the hook. Each hookhas a defined set of parameters and a specified result type. To extend Drupal, a module need simply implement a hook.


Jira quickref


Managing issue type schemes

  1. Choose > Issues. 
  2. Select Issue Types > Issue Type Schemes to open the Issue Type Schemes page, which displays all existing issue type schemes, their related issue types and their associated projects.

Flagging an issue


You can flag an issue to indicate that it's important. The card of a flagged issue is displayed in yellow in the Scrum backlog, Active sprints of a Scrum board, Kanban backlog (if enabled), and Kanban board, with the 'flag' icon replacing the priority icon.


You can later get only flagged cards using JQL. Because the flag for an issue is stored in a custom checkbox field named "Flagged" with only one value: Impediment, you can find flagged issues: Flagged = Impediment.

How do I move issues from one board to another

You don't.
Boards are views of lists of issues, they don't hold any issues really. To "move" an issue, you change the boards. You should create your new board, and make sure it includes the issues you want to "move". Then go to the existing board, and change the filter so it no longer includes the issues.

References

Metatag

The Metatag module allows you to automatically provide structured metadata, aka "meta tags", about a website. In the context of search engine optimization, when people refer to meta tags they are usually referring to the meta description tag and the meta keywords tag that may help improve the rankings and display of a site in search engine results. In addition, the module provides support for meta tags (Open Graph Protocol from Facebook, Twitter Cards from Twitter) that allow control of how content appears when shared on social networks.

References

martes, 22 de noviembre de 2016

Parse.ly

Parse.ly partners with digital publishers to provide clear audience insights through an intuitive analytics platform. 
Thousands of writers, editors, site managers, and technologists use Parse.ly to understand what content draws in website visitors, and why. Using our powerful dashboards and APIs, customers build successful digital strategies that allow them to grow and engage a loyal audience. 
Industry leaders -- like Mashable, Slate, News Corp, and Conde Nast -- partner with Parse.ly to bring clarity to content, audience, and analytics.
The first part of the two step integration with Parse.ly tracking, is the installation of the tracking code. Jump to documentation about the metadata tag once you have the JavaScript running!
<!-- START Parse.ly Include: Standard -->
<div id="parsely-root" style="display: none">
  <span id="parsely-cfg" data-parsely-site="##########"></span>
</div>
<script>
    (function(s, p, d) {
      var h=d.location.protocol, i=p+"-"+s,
          e=d.getElementById(i), r=d.getElementById(p+"-root"),
          u=h==="https:"?"d1z2jf7jlzjs58.cloudfront.net"
          :"static."+p+".com";
      if (e) return;
      e = d.createElement(s); e.id = i; e.async = true;
      e.src = h+"//"+u+"/p.js"; r.appendChild(e);
    })("script", "parsely", document);
</script>
<!-- END Parse.ly Include: Standard -->
Copy and paste the code block above. Notice that there is a configuration tag (parsely-cfg) which has a data property,data-parsely-site="##########". You must replace the "##########" with your own site domain name, e.g. "mysite.com".

The Metadata tag

The json-ld script tag is used to reliably identify information about the page, like the author, publishing date, title, and the section it belongs to. Add the tag to the <head> element of the tracked pages. The content parameter should be a JavaScript dictionary serialized to JSON.
<script type="application/ld+json">
      {
        "@context": "http://schema.org",
        "@type": "NewsArticle",
        "headline": "Zipf's Law of the Internet: Explaining Online Behavior",
        "url": "http://blog.parsely.com/post/57821746552",
        "thumbnailUrl": "http://blog.parsely.com/inline_mra670hTvL1qz4rgp.png",
        "dateCreated": "2013-08-15T13:00:00Z",
        "articleSection": "Programming",
        "creator": ["Alan Alexander Milne"],
        "keywords": ["statistics","zipf","internet","behavior"]
      }
</script>

References


Drush

Drush: The Drupal Shell

Drush is a command line shell and Unix scripting interface for Drupal. Drush core ships with lots of useful commands for interacting with code like modules/themes/profiles. Similarly, it runs update.php, executes sql queries and DB migrations, and misc utilities like run cron or clear cache. Drush can be extended by 3rd party commandfiles.

See main information and status of the site
drush status

Open a SQL command-line interface using Drupal's credentials.
drush sql-cli

Clear the cache
drush cc all

This will return a list of all the projects on your site.
drush pml --no-core

References

jueves, 17 de noviembre de 2016

Entity

The Drupal community often compares site building through configuration to a favorite childhood toy: LEGO bricks. We can build Entity types, which can make Bundles, to which we can add Fields and then create Entities. This article explains the relationships between Entity types > Bundles > Fields > Entities.

Putting this in Object-Oriented Design/Programming terms...

If you come from an OOD/P background and are trying to better understand what these key D7 concepts are, the following suggested mapping might help (albeit not strictly true from a purist’s perspective) :
  • An entity type is a base class
  • A bundle is an extended class
  • A field is a class member, property, variable or field instance (depending on your naming preference)
  • An entity is an object or instance of a base or extended class

References

Rules

The Rules module allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules). It's a replacement with more features for the trigger module in core and the successor of the Drupal 5 workflow-ng module.
When you activate the Rules Scheduler module (ships with Rules), you get a new action for each rule set, which allows you to schedule the rule set execution. This allows you to schedule everything, by moving it into a rule set and scheduling the execution of this set. When you want to have something scheduled repeatedly, just schedule the rule set again from inside the scheduled rule set.

Components

Reaction rules are the simplest and usually most common Rules configurations. But you can also create Rules components – re-usable condition sets, action sets, single rules or sets of rules. These components can then be called by reaction rules, saving you the work of re - peating the same conditions in three different reaction rules.

More about rules

CCK

Content Construction Kit (CCK)

The Content Construction Kit allows you to add custom fields to nodes using a web browser.
Most of CCK has moved to core in the Drupal 7 version.
Here are a few other comprehensive documentation and tutorial resources to help get you started:

References


Field Permissions

The Field Permissions module allows site administrators to set field-level permissions to edit, view and create fields on any entity.
Module url: drupal.org/project/field_permissions
Overview: drupalmodules.com/module/field-permissionsThe Field Permissions module is fully compatible with the permissions already defined with Content Permissions module shipped with CCK.

martes, 15 de noviembre de 2016

Sprint planning para equipos con muchas interrupciones

¿Qué pasa si tu equipo no es como lo describe la literatura de Scrum?
Algunos tips que encontré (y otros que pienso pueden dar resultado):
  • Aumentar la duración de los sprints para "amortiguar" el efecto de las interrupciones. Si haces el ejercicio de pensar en un sprint de 1 año de duración, una semana de interrupciones constantes no debería afectar el rendimiento de ese super-sprint.
  • Acortar la duración del sprint, y vivir sabiendo que no podremos asegurar que se llegará con cierta funcionalidad para determinado momento.
  • Las plannings deberían de ser cortas (~30 mins). Comparar el esfuerzo de planificar una fiesta (una boda) con una fiesta (juntarse a mirar un partido y comer unas pizzas). La planning debería requerir el mismo esfuerzo que esto último.
  • Asignar una porción del tiempo del sprint para initerrupciones (que se sume al tiempo de bugs e historias mal estimadas)
  • Negociar las interrupciones: si un stakeholder interrumpe el sprint, luego de estimar el tiempo que consumirá dicha interrupción, se deberá intercambiar por alguna otra historia del mismo puntaje. Para esto el stakeholder que interrumpió el sprint deberá negociar con otro stakeholder dueño de alguna historia por hacer en este sprint.
  • Commitment velocity: la idea es tomar el mínimo histórico y usarlo como base para generar confianza en el equipo. El compromiso del equipo es llegar al menos al mínimo histórico (dando lugar a interrupciones). Sobre esa base, si sistemáticamente se comienza a tener un "mejor" rendimiento, se puede llegar a subir esa línea base.

Referencias



Forecast

One of the most controversial updates to the 2011 Scrum Guide has been the removal of the term “commit” in favor of “forecast” in regards to the work selected for a Sprint. We used to say that the Development Team commits to which Product Backlog Items it will deliver by the end of the Sprint.
Scrum now encourages the Development Team to forecast which Product Backlog Items it will deliver by the end of the Sprint. It may seem to be a simple wording change, but in fact there are strong reasons behind it, and surely it will have great implications.

References


(some) Agile antipatterns

This is a list of (some) agile antipatterns, mostly around performance or velocity concepts:

Related with Burndown Chart:
  • The team finishes early sprint after sprint because they aren't committing to enough work. 
  • The team misses their forecast sprint after sprint becase they're committing to too much work. 
  • The burndown line makes steep drops rather than a more gradual burndown because the work hasn't been broken down into granular pieces.
  • The product owner adds or changes the scope mid-sprint.
Related with Velocity:
  • Are there unforeseen development challenges we didn't account for when estimating this work? How can we better break down work to uncover some of these challenges?
  • Is there outside business pressure pushing the team beyond its limits? Is adherance to development best practices suffering as a result?
  • As a team, are we overzealous in forecasting for the sprint

References


lunes, 14 de noviembre de 2016

MVVM

Model–view–view-model (MVVM) is a software architectural pattern. MVVM facilitates a separation of development of the graphical user interface – be it via a markup language or GUI code – from development of the business logic or back-end logic (the data model).

Source: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel

martes, 9 de agosto de 2016

Escenario complejo para la generación de patrones de diseño

Estaba analizando un par de tecnologías "nuevas" (al menos para mi), en particular ReactJS, AMP, NodeJS y me puse a pensar en lo difícil que es generar patrones de diseño en un escenario tan cambiante como el desarrollo web.

En el pasado, cuando Java dominaba y todo era OOP puro, uno como desarrollador iba incorporando patrones "descubiertos" por autores que se iban generando lentamente. El ritmo con el que se generaban no era caprichoso, sino que respondía a que dichos patrones surgían justamente de una repetición consecutiva de problemas prácticos que eran abstraídos. Y luego de abstraídos, eran probados nuevamente en la práctica para asegurarse de que los mísmos resolvían el problema que los había originado.

Ahora vuelvo a pensar en el escenario de tecnologías que tenemos hoy. Tenemos:

  • tecnologías de frontend (ReactJS, Angular, Ember, Backbone y un largo etc.) que trabajan siguiendo el patrón MVC, MVVM, MV-Whatever, que además están implementados en un lenguaje que no es completamente orientado a objetos, tiene aspiraciones a ser funcional y de a ratos parece procedural (Javascript por las dudas).
  • tecnologías de backend (Ruby on Rails, Django, Node.JS, ASP.NET MVC, Spring MVC, Vaadin, GWT, JSF y otro largo etc.), alguno de ellos implementados en lenguajes donde el uso de patrones está más generalizado y otros que permiten múltiples paradigmas de desarrollo (y todos ellos combinando OOP puro con pinceladas de funcional).
  • tecnologías hibridas para dispositivos móviles (Cordova, Ionic, et.)
  • tecnologías para dispositivo móviles (Swift, Java for Android y un etc. más corto)
No tengo una conclusión, solo que me parece un ambiente muy complejo y sobre todo cambiante, lo que no deja estabilizar tecnologias, detectar problemas comunes y realizar esas abstracciones denominadas patrones.

Razón de este blog

La idea es este blog (como su nombre lo indica) es volcar pensamientos. Ojo que no son ideas terminadas o procesadas... ni siquiera tiene porque ser del todo correctas (si bien intentaré que así sea) por lo que les pido que tomen esa información como tal.

Si alguien quiere discutir lo expresado aquí, piensa que debería ser corregido e incluso retirado del blog, puede contactarme y lo tendremos en cuenta.