Promises in AngularJS, Explained as a Cartoon One morning, a father says to his son: "Go and get the weather forecast, son!" Every Sunday morning, a father asks his son to go and find out the weather forecast for the afternoon, by using his super-strong telescope to look across the horizon from the tallest hill by their house. The son promises his dad he will go and get the weather forecast. He creates a promise with his dad at the door when he leaves. At that point, the dad decides if the weather tomorrow is good, he'll prepare a fishing trip for tomorrow. If it's bad he won't. After 30mins or so, the son comes back. Outcome A) Weather forecast retrieved! The son succeeded in retrieving the weather forecast, clear skies and sunshine! Outcome B) Weather forecast retrieved! The son succeeded in retrieving the weather forecast, but it looked like cloudy and rain. Outcome C) Couldn't get the weather forecast :-/ How does this look in code? Controller: FatherCtrl The father is controlling the situation here: Service: SonService Summary
Curso de jQuery (2): Selectores, Primera Parte Por un selector entendemos en jQuery lo mismo que en CSS: una forma de permitirnos elegir un elemento (o varios) entre todos los que tenemos en nuestro documento HTML. ¿Para qué? Para luego poder aplicar sobre los elementos seleccionados diversas funciones. Es decir, jQuery utiliza el poder de los selectores para acceder de una manera rápida y sencilla a un elemento o grupo de elementos del DOM (Document Object Model) y luego poder aplicar sobre los mismos cualquier tipo de instrucción, evento, animación, etc…. Pero vamos a empezar desde el principio. Antes de nada es importante saber que el DOM (Document Object Model, el esqueleto de nuestra página web) utiliza una estructura de árbol para definir las relaciones entre sus elementos, en la que tenemos padres, hijos, etc… Por ejemplo: $(‘selector’) No importa qué tipo de selector usemos en jQuery: siempre comenzaremos con $(). Selectores CSS Selectores propios de jQuery Vamos a distinguir entre ellos: Otros capítulos del curso
csvfix - CSVfix is a tool for manipulating CSV data News: As Google has disabled the ability to provide binary downloads here, and as I want to do a release of CSVfix 1.6 in the not too distant future, I'm in the process of moving this site to Bitbucket. The source code and the manual are already there, and I hope to transfer all other content in the next few days (neilb, 12/04/2014) The Problem If you have any dealings at all with data and databases, then you almost certainly will have have to deal with comma-separated values (CSV) data. Unfortunately, the CSV files you are given, or are required to produce, never seem to be in quite the right format for your particular business application. And because of the structure of CSV records, using standard text processing tools like sed, awk and perl on CSV files is not as simple as it might be. The Solution CSVfix is a command-line tool specifically designed to deal with CSV data. The CSVfix manual, detailing all commands, is here.
browserify Top 10 Apps: Web-based Task Managers I’ve been jumping from app to app, for as long as I can remember, in search of the best web-based task management app. I’ve never really been satisfied until recently when I discovered Flow. Finding the perfect task manager is a little like searching for a unicorn — it’s just not going to happen. Hopefully our list of the 10 best web-based task management apps will help in your search, if you haven’t already found yours. Note: I’ve ordered these according to my personal preferences and experiences but your mileage may vary. 1. Producteev In my quest for the perfect task manager, Producteev stood out as being one of the absolute best, without a doubt. Producteev isn’t just fantastic for the individual, it’s built for teams too. Pricing Producteev Pricing 2. Flow If you’re a fan of Mac-style interface designs, Flow will likely appeal to you. Flow has an elegance, simplicity and seamless functionality about it that just gets me. It’s not cheap, but some may find its worth the price. 3. 4. 5.
D3.js - Data-Driven Documents Atmosphere/atmosphere