Fetch API – was I living on Mars?

I stumbled upon Fetch API today. It’s this simple:

fetch(url)
  .then((resp) => resp.json()) // Transform the response object into json
  .then(function(data) {
    // Do what the hell I want to do with received JSON data
    })
  })

 

Seriously! I must have been living on Mars to have not noticed it earlier. XMLHttpRequest and jQuery.ajax — time to move on, ba bye!

Coding a neural network in plain JavaScript!

Sounds completely insane, doesn’t it? Mattias Petter Johansson (mpj) has done just that. The best part is that mpj is as clueless about NN’s computer science or mathematical details as probably you are. He has posted a 3-part tutorial about it on his popular YouTube channel Fun Fun Function. I like to think of it as neural networks for JS-coding dummies!

I saw the first part. It’s fun!

TypeScript, whoa!

typescript-cover-image

Finally the time has come. I had been avoiding it for years. I cannot escape it anymore. Finally the time has come to learn and embrace TypeScript.

I am developing a small proof of concept mobile app at work. Creating mobile apps, especially hybrid ones, is not a big task anymore. Only this time instead of relying on trusty old Ionic 1.x, I’m using the still-in-beta Ionic 2. As you know, Ionic 2 is based on Angular 2 and Angular 2 encourages using TypeScript instead of ye old JavaScript.

The opportunistic monkey inside me is making me do this. I am on a deadline, and my common sense begs me not to break out of routine. But I am helpless. It’s the year of the monkey.

Anyway, I found this nice quick start tutorial.

Bye.ts

Ruby and ES6

puts "Hello, #{first_name}. What are you upto today?"
console.log (`Hello, ${firstName}. What are you upto today?`)

So, I am learning Ruby these days. You have heard of this book, haven’t you? Learn Ruby the Hard Way. Me? I found it only a few days back. It’s been a fun read so far. Give it a whirl, even if you are a ninja programmer.

And I am learning ES6 as well. Part of my motivation came from seeing the excitement of my students at Ofssam for learning ES6 (ECMAScript2015 for the standards Nazis). Here’s my learning resource – Using ES6 in Your Node.js Web Application.