Learn ES6 with Katas

One of my colleagues pointed me in the direction of this great JavaScript ES6 learning resource.

es6katas.org/

Working my way through the ES6 katas.

There’s ES5, ES6, then ES7, TypeScript, AtScript, Dart, Babel…the list goes on

 

WTF is ES6?

Javascript as browsers understand it is a bit like the “assembly of the web,” meaning that it can correctly run code that was implemented in a higher level language and “compiled” down to JS the browser understands.

 

The Man in the Arena

My contemporaries believe that happiness is best found in boundless pleasure with the absence of stress but the entrepreneur knows that happiness is not pleasure – it’s victory. It’s found in overcoming challenges, of sometimes doing the impossible, of achieving way beyond what even they thought possible.
The entrepreneur discovers happiness as Theodore Roosevelt’s “The Man in the Arena” – 
“who spends himself in a worthy cause; who at the best knows in the end the triumph of high achievement, and who at the worst, if he fails, at least fails while daring greatly, so that his place shall never be with those cold and timid souls who neither know victory nor defeat”.


Quora Commenter

 

Review: Headspace.com

The practice of meditation is old. Very old. And it’s free. And it’s cheap. And all the equipment you need you already (hopefully) have.

Headspace logoA pair of eyes to close and lungs to breath with.

So why then are over 1 million people using the headspace app?

Headspace provide a free app with 10 introductory lessons to get your started on mindfulness mediation. Each lesson is 10 minutes long and guided by the headspace creator and mindfulness expert Andy Puddicombe.

Headspace is meditation made simple. Learn online, when you want, wherever you are, in just 10 minutes a day.

Once you’ve completed those you can sign up for a monthly fee of 9.99 euro or yearly subscription at 5.99 euro per month. On paying you’ll get access to a range of mediation courses. Recently I completed the 10 lesson trail and surprised myself by signed up for my first paid month.hero-ten-minutes

Progression. The app tracks your meditation stats including total time and frequency.

Learning: Actually teaches you meditation through slowly revealing aspects across the 10.

Competitive: You can invite your friends and compete on who can best/most hardcore meditator. If that’s your thing.

Benefits: At headspace.com you’ll discover the many benefits of meditation. Backup by links to the research.

MongoDB for Node.js Developers Course

MongoDB University

Recently I completed the MongoDB for Node.js Developers Course from (MongoDB University)[https://university.mongodb]. This is my experience..

Course Overview

It’s a 7 week online course that covers using mongoDB and Node.js. Each week you’ll have 20 – 30 short (5 to 10 minute) video lessons followed by a quiz. The quiz can be multiple choice or writing javascript + mongoDB queries.
The quiz results do not count towards the final grade.
At the end of each week there is a homework assignment to complete and submit for verification.

Expect to spend ~3 hours on lessons and other couple on homework per week. It can be challenging to keep up the momentum of 7 weeks.

Grading

The homework assignments from each week will make up 50% of your final grade. The other 50% for a final exam.
65% is the overall grade you’ll need to hit to pass. Upon passing you’ll get a ‘cert’ from MonogoDB University. I’m expecting to receive mine in the next few weeks. After christmas 🙂

Course Structure

  • Week 1: Introduction – Installing, mongo shell, installing tools, node modules, swig, express
  • Week 2: CRUD – Mongo shell, queries, update, operators etc
  • Week 3: Patterns, case studies, trade offs
  • Week 4: Performance – indexes, monitoring, sharding
  • Week 5: Aggregation Framework – pipeline, SQL comparisons
  • Week 6: Replication and sharding
  • Week 7: Intro to Mongoose and FINAL EXAM

Conclusion

Worth it.
I came to this course with little knowledge of MongoDb. I had done several tutorials + read a couple of books.

However through the lessons, quizzes, homework etc, I picked up a decent bit of practical experience and theoretical knowledge for getting up and running. And if I’m luckily …for scaling out.

Also did I mention it’s a free course?

Do not believe in anything simply because you have heard it.
Do not believe in anything simply because it is spoken and rumoured by many.
Do not believe in anything simply because it is found written in your religious books.
Do not believe in anything merely on the authority of your teachers and elders.
Do not believe in traditions because they have been handed down for many generations.
But after observation and analysis, when you find that anything agrees with reason and is conducive to the good and benefit of one and all, then accept it and live up to it.

Gautama Buddha

Tutorial 4: Sencha Weather App – OpenWeatherMap Api + Model + Store

Register on OpenWeatherMap

OpenWeatherMap provides a handy api for guess what? That’s right weather reports. Follow the steps to register and get a URL endpoint.

  1. Register at: http://openweathermap.org/API
  2. Click Free API
  3. Click ‘more’ under ‘Get Current Weather Data’

This is the default example:

api.openweathermap.org/data/2.5/weather?q=London,uk

We have some options to format the data coming back:

api.openweathermap.org/data/2.5/weather?units=metric&q=Dublin, IE

See the JSON response with Dublin related weather reports. This will do for the moment.

Next add the weather API to our Sencha app.

In keeping with best practice we will add this configuration to the app.js in our app root. Seems like a good place of it.

In time I will want to make the location configurable so I’ve broken into two variables. Plus a variable for the location of the images the openweathermap kindly provide.

 /* configuration openweathermap API */
    weatherAPI: 'http://api.openweathermap.org/data/2.5/weather?units=metric&q=',
    defaultCountry: 'Dublin,ie',
    openweatherimages: 'http://openweathermap.org/img/w/',

Model

The model will describe the shape of the data. We’ll shape the data we get back from the above URL.

1) Create the model file app/model/Weather.js
The names on the field array are taken form the JSON response.

Ext.define('WeatherApp.model.Weather', {
    extend: 'Ext.data.Model',
    config: {
        fields: ['name', 'main', 'country', 'sys', 'weather']
    }
});

API JSON response:

{"coord":{"lon":-6.26719,"lat":53.34399},"sys":{"country":"IE","sunrise":1372132698,"sunset":1372193845},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"base":"global stations","main":{"temp":18.4,"humidity":58,"pressure":1028,"temp_min":18,"temp_max":18.89},"wind":{"speed":4.63,"gust":4.63,"deg":247},"clouds":{"all":80},"dt":1372179878,"id":2964574,"name":"Dublin","cod":200}

Our model object will have attributes name, main, country, sys, weather. We can pull the data from the object via these attributes.

But we need to get the data in to the model in the first place. Enter stores.

Oh yes, we’ll need to add our model to our app.js, as we previously did with views.

A store for Weather

In the previous tutorial we hooked up a view to the Weather store.  But we didn’t create the store. We’ll do that now:

app/store/Weather.js

Ext.define('WeatherApp.store.Weather', {
    extend: 'Ext.data.Store',

    config: {
        model: 'WeatherApp.model.Weather',
        //autoLoad: true,
        proxy: {
            type: 'jsonp',
            url : WeatherApp.app.weatherAPI + WeatherApp.app.defaultCountry,
            reader: {
                type: 'json'
            }
        }
    }
});

THE NEXT STEPs FOR US:

  • A new tab panel for location
  • An input field to allow the user to enter a location.
  • Model and store to save the location to local storage.
  • A controller to manage the interactions between the view and the store.

CODE HERE:

https://github.com/jamiegood/WeatherApp/tree/InputWeatherLocation