Log 1 | Log 2 | Log 3 | Log 4 | Log 5 |
---|---|---|---|---|
100 Days Round 1 | this log | 100 Days Round 3 | 100 Days Round 4 | 100 Days Round 5 |
This is part of Alexander Kallaway's 100DaysOfCode challenge. More details about the challenge can be found here: 100daysofcode.com.
Commitment: I will code daily for the next 100 days.
Start Date | End Date |
---|---|
January 28, 2018 | May 8, 2018 |
Project: Google Udacity Nanodegree (Mobile Web Specialist)
Progress: Completed Lesson 5: Optimizations from the Udacity course: Responsive Web Design Fundamentals.
This lesson dealt with how to adapt:
Read more: Notes - Responsive Web Design Lesson 5: Optimizations
Links:
Project: Google Udacity Nanodegree (Mobile Web Specialist)
Progress: Completed Lesson 4: Common Responsive Patterns from the Udacity course: Responsive Web Design Fundamentals.
The end of this lesson asked us to put what we learned into practice by implementing a combination of patterns, breakpoints, and layouts to make an existing site responsive.
Live Sample - The Brighton Times
Read more: Notes - Responsive Web Design Lesson 4: Common Responsive Pattern 4.11 & 4.12
Links:
Project: Google Udacity Nanodegree (Mobile Web Specialist)
Progress: Completed more of Lesson 4: Common Responsive Patterns from the Udacity course: Responsive Web Design Fundamentals. This lesson details four of the most commonly used responsive layout patterns.
These include:
Column Drop (https://codepen.io/james-priest/pen/KRXeKo)
Mostly Fluid (https://codepen.io/james-priest/pen/XqeYjQ)
Layout Shifter (https://codepen.io/james-priest/pen/KRygva)
Off Canvas (https://codepen.io/james-priest/pen/xjPdwe)
Read more: Notes - Responsive Web Design Lesson 4: Common Responsive Pattern 4.7 - 4.10
Links:
Project: Google Udacity Nanodegree (Mobile Web Specialist)
Progress: Started Lesson 4: Common Responsive Patterns of my Responsive Web Design Fundamentals course. This lesson details four of the most commonly used patterns.
These include:
Column Drop (https://codepen.io/james-priest/pen/KRXeKo)
Mostly Fluid (https://codepen.io/james-priest/pen/XqeYjQ)
Layout Shifter
Off Canvas
Read more: Notes - Responsive Web Design Lesson 4: Common Responsive Pattern 4.1 - 4.3
Links:
Project: Google Udacity Nanodegree (Mobile Web Specialist)
Progress: Completed Lesson 3: Building Up of my Responsive Web Design Fundamentals course. This lesson continued discussing the building blocks of responsive design.
The lesson covered:
min-width
& max-width
min-device-width
and max-device-width
You can read more here: My Notes - Responsive Web Design Lesson 3: Building Up
Links:
Project: Google Udacity Nanodegree (Mobile Web Specialist)
Progress: Completed Lesson 2: Starting Small of my Responsive Web Design Fundamentals course. This lesson showed how to design for mobile first.
The lesson covered:
You can read more here: My Notes - Responsive Web Design Lesson 2: Starting Small
Links:
Project: Google Udacity Nanodegree (Mobile Web Specialist)
Progress: Completed Lesson 1: Why Responsive? of my Responsive Web Design Fundamentals course.
The lesson covered:
You can read more here: My Notes - Responsive Web Design Lesson 1: Why Responsive?
Links:
Project: Configuring Console (Cmd, PowerShell, & Bash) colors on Windows 10
Progress: The default console colors were pretty bad when Bash on Ubuntu on Windows was first released in August of 2016 as part of the Windows Anniversary Update.
The first thing I did was to update the directory color to be more readable. This is done by making a change to the ~/.bashrc
file. I found an Ask Ubuntu article that details the process.
LS_COLORS=$LS_COLORS:'di=0;36:'; export LS_COLORS
This change gave windows directories a cyan color which was better but it still left the default color scheme pretty hard to read.
Now with the April 2018 release Microsoft has updated the default color scheme for Console. Unfortunately, it only takes effect on new installs. For exisitng installations you have to manually do this. Fortunately, Microsoft released a tool that makes this much easier to do than before.
With the Microsoft Console ColorTool you can apply any iTerm2 color scheme to your console.
Now I have a great terminal experience that feels closer to *nix than ever before.
For more information on how to do this, see the links below.
Links:
Project: Configuring Linux on Windows 10
I've now updated my software sources, upgraded existing packages, and installed new ones for my Ubuntu instance on Windows 10.
Progress: Right now, if I use Vim to open my ".bashrc" file it show this.
This is really hard to read with the default color scheme and currently it's not very easy to update.
So, the next step was to open a browser and go to http://vimconfig.com. This generates a config file (.vimrc
) that you can drop into your home (~
) directory.
I used Vim to create the resource file. I then saved the file out to my home directory.
vim ~/.vimrc
The file has the following settings and the only setting I added manually was the last one which uses set background=dark
to make everything readable until I can get around to updating the color scheme globally.
set number
set linebreak
set showbreak=+++
set textwidth=100
set showmatch
set visualbell
set hlsearch
set smartcase
set ignorecase
set incsearch
set autoindent
set shiftwidth=4
set smartindent
set smarttab
set softtabstop=4
set background=dark
The final result looks like this.
Links:
.vimrc
in home directoryProject: Configuring Linux on Windows 10
Now that I have the Windows Subsystem for Linux (WSL) feature turned on and Ubuntu installed, I can proceed to configure my Linux terminal.
Progress: The first thing I did was to check out Apt. It's a new package manager introduced in Ubuntu 16.04 that simplifies "apt-get" commands by providing more intuitive syntax for better usability. This is not a layer on top of "apt-get" but a new set of terminal commands to interact with packages.
The first step is to update the software sources.
sudo apt update
You can then view what needs upgrading by issuing this command.
apt list --upgradable
Or you can simply tell Apt to upgrade everything that needs upgrading.
sudo apt upgrade
To install a package you simply issue the "install' command. You can install multiple packages like this.
sudo apt install ruby2.3 ruby2.3-dev build-essentails
Here's a list of basic commands
Links:
Project: Install Jekyll on Windows Subsystem for Linux (WSL)
This involves switching my build system from an Ubuntu VM to the new Windows Subsystem for Linux (WSL).
WSL is a compatibility layer for running Linux binary executables natively on Windows 10.
You can then install one or more distros from the Windows Store. I installed Ubuntu which provides the ability to launch a terminal window (Ubuntu Bash) from Windows taskbar, console, or from within Visual Studio Code.
What this means is that we can now run our Linux build systems natively. This includes Nodejs, Jekyll, Ruby, Rails, Python, etc. without having to install Windows versions of Linux tools.
Progress: This code log as well as other sites I use for course notes and projects are built using Jekyll and hosted on GitHub as GitHub Pages.
Jekyll is a static site generator & build system. It's written in Ruby and relies heavily on Gems. It's what GitHub uses to auto-generate GitHub Pages.
It's designed to run on *nix environments and must be run locally if you want to preview your work before going live. This means, that once you push a commit, it moves the files to GitHub and immediately triggers the build system to auto-generates the site.
Until now I've been running Ubuntu 16.04 Xenial in a local VM. This is not the most streamlined solution and produced build times that would take between 20-30 seconds on each save. This was pretty clunky and produced an extra layer to maintain.
Prior to WSL, the other possible alternative was to install the Windows versions of various Linux tools and hope that you could get them configured and working well with each other within the Windows environment. This always ended up being an exercise in frustration.
Now that I have WSL installed, my build time has dropped to under 5 seconds per save operation and is half of that (1-2 seconds) if I enable Jekyll's incremental build option!
Now I have a legit Linux terminal running in VSCode which cracks the development universe wide open.
I no longer have to fear or avoid the ($
) prompt in online tutorials and coding exercises! I can now run Windows and Linux terminal side-by-side!
Links:
Project: Google Udacity Nanodegree (Mobile Web Specialist)
Progress: Today's lesson detailed the need for responsive design and set the stage for how to develop and test sites designed for mobile devices, using a mobile-first approach.
Two methods of testing were discussed.
Testing using the built-in device emulators from within Chrome is fairly straight-forward and can be done right from DevTools.
Using an actual device is a bit more involved in that it requires:
chrome://inspect
This establishes a bridge to the target device so that pages run on it can be debugged in DevTools on your development machine.
Very cool!
Links:
Project: Google Udacity Nanodegree (Mobile Web Specialist)
Progress: Started my Google Udacity Nanodegree program today! This Grow with Google Scholarship program is awesome. It provides a super rich environment for learning that includes:
I attended the live student orientation on Tuesday and spent yesterday (Wednesday) doing the following:
Today is the day I actually jump into the material starting with Lesson 1: Mobile Web Specialist Nanodegree Orientation.
I'm energized and ready to learn!
Links:
Project: Add to CodePen work samples
Progress: Posted a Geolocation API code sample onto CodePen. This uses Google Maps to display a map with coords, TERRAIN map-type, marker, & zoom-level.
Links: https://codepen.io/james-priest/pen/gzMMod
Project: Add to CodePen work samples
Progress: Posted my drag and drop samples and exercises onto CodePen. This is a scramble game to uses a bit more code and logic than the proof-of-concept.
Links: https://codepen.io/james-priest/pen/aGZNjb
Project: Add to CodePen work samples
Progress: Posted my drag and drop samples and exercises onto CodePen. This one is a proof of concept and tests both drag and drop events.
Links: https://codepen.io/james-priest/pen/LmZNeV
Project: Add to CodePen work samples
Progress: Posted previously created <canvas>
work onto CodePen. Another series of lines and arcs using beginPath()
, arc()
, arcTo()
, fill()
, and stroke()
.
Links: https://codepen.io/james-priest/pen/wjMvWV
Project: Add to CodePen work samples
Progress: Posted previously created <canvas>
work onto CodePen. This one uses beginPath()
, arc()
, arcTo()
, fill()
, and stroke()
.
Links: https://codepen.io/james-priest/pen/YLwKoL
Project: Add to CodePen work samples
Progress: Posted previously created <canvas>
work onto CodePen. This one uses the strokeRect()
method to create rectangle outlines with gradients.
Links: https://codepen.io/james-priest/pen/XqXryK
Project: Add to CodePen work samples
Progress: Posted previously created <canvas>
work onto CodePen. This uses the fillStyle()
method to create some rectangles with gradients.
Links: https://codepen.io/james-priest/pen/wjMwmQ
Project: Upgrade from Windows 8.1 to Windows 10 v1709 Fall Creator's Update
I decided to make the switch to Windows 10. I had been hesitant to upgrade until I came across some new features that I couldn't do without.
Linux Bash Shell is one and Linux Containers on Windows is another...
Here's what it is and what it offers.
Docker for Windows & LCOW will now allow you to spin up containers for both environments. This was stated in a Docker blog post:
"Developers will be able to more easily build and test mixed Windows/Linux Docker applications by running containers for both platforms side-by-side on the same system."
Progress: Installed Edge version of Docker for Windows Desktop app. This turned on certain Windows features such as Containers and Hyper-V.
Enabling Hyper-V did prevent VMware from running due to issues with VMware running under hypervisor. This was solved by issuing the following command thru elevated Cmd prompt.
bcdedit /set hypervisorlaunchtype off
Links:
Project: Upgrade from Windows 8.1 to Windows 10 v1709 Fall Creator's Update
I decided to make the switch to Windows 10. I had been hesitant to upgrade until I came across some new features that I couldn't do without.
Linux Bash Shell is one...
Progress: Once Windows was up and running properly, I had to turn this feature on. It's under Control Panel > Programs > Turn Windows Features On Or Off. From there you enable the "Windows Subsystem for Linux" option.
After you enable the feature you must install a Linux distribution from the Windows Store. I chose Ubuntu although there are many others. Once installed, I was good to go.
Here are some highlights.
apt
or apt-get
to install packagesNow I can do things like run Ruby and Jekyll right from Windows rather than incur the overhead of running a build system in a Linux VM. That will help with this blog in particular.
Links:
Project: Upgrade from Windows 8.1 to Windows 10 v1709 Fall Creator's Update
I finally decided to make the switch to Windows 10. I had been hesitant to upgrade because I had everything fine-tuned and working beautifully on Win 8.1.
I figured I would wait until a must have feature emerged in Windows 10 that I couldn't do without. There were two...
More on these two features in upcoming posts.
Progress: This took 3+ days due to issues with the Media Creation Tool and my slow internet connection. The tool would fail the installation after a 5-6 hour download. It would then start whole process over again.
I was able to fix what turned out to be permissions issues on the filesystem, registry, & firewall. I also virus scanned the system to make no infections were causing the problem.
Once this was done, I created installation media and did the following.
Once the upgrade was done I:
Links:
Project: Azure Research and Evaluation
Progress: I attended the Azure Developer Tour in Los Angeles earlier this week. It was a one-day event that covered the following.
This was a great experience. I got a chance to see how easy it is to host services in the cloud and also got some exposure to new technologies I didn't realize were ready for prime-time.
You can manage your services through a cool dashboard.
You can access your app and write code through their App Service Editor which works Visual Studio Code. It has Version Control (Git), a File System Browser, and Integrated Debugger.
Links:
Project: Tyler McGinnis' React Bootcamp
Progress: Completed this four day class which serves as a great introduction to React. The course is taught by Tyler McGinnis who created Udacity's React Nanodegree program. He also has a series of React(v16.3) courses on his website. (https://tylermcginnis.com/).
Day 4 covered:
create-react-app
npm package to create a react app scaffold and build environmentreact-router-dom
package) to create routes, nested routes, & dynamic routesLinks:
Project: Tyler McGinnis' React Bootcamp
Progress: This is a four day class which serves as a great introduction to React. The course is taught by Tyler McGinnis who created Udacity's React Nanodegree program. He also has a series of React(v16.3) courses on his website. (https://tylermcginnis.com/).
Day 3 covered:
Links:
Project: Tyler McGinnis' React Bootcamp
Progress: This is a four day class which serves as a great introduction to React. The course is taught by Tyler McGinnis who created Udacity's React Nanodegree program. He also has a series of React(v16.3) courses on his website. (https://tylermcginnis.com/).
Day 2 consisted of:
React.Component
props
objectLinks:
Project: Tyler McGinnis' React Bootcamp
Progress: This four day class served as a great introduction to React. Each day consisted of a live YouTube session lasting about two hours in which a key concept of the library was covered. We then put what was learned into practice by following along with many code examples.
The course is taught by Tyler McGinnis who created Udacity's React Nanodegree program. He also has a series of very current React(16.3) and related courses on his website. (https://tylermcginnis.com/).
Day 1 consisted of:
React.createElement()
constructLinks:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: Today's lesson focused on executing table JOINS and creating aggregate functions with with GROUP BY. These include COUNT()
, MIN()
, MAX()
, AND SUM()
.
// JOIN syntax
var db = openDatabase('Library', '1.0', 'My library', 5 * 1024 * 1024);
var lastName = 'D%';
db.transaction(function(t) {
t.executeSql("SELECT a.firstName, a.lastName, b.title " +
"FROM authors a " +
"INNER JOIN books b on a.id = b.authorId " +
"WHERE lastName LIKE ?"
, [lastName], displayResults);
});
// GROUP BY syntax
db.transaction(function(t) {
t.executeSql("SELECT a.firstName, a.lastName, COUNT(b.id) as numOfBooks " +
"FROM authors a " +
"INNER JOIN books b on a.id = b.authorId " +
"GROUP BY a.id"
, [], displayResults);
});
Read here: Chapter 16 - Offline Web Applications: Web SQL - Filtering Results.
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: Today's lesson focused on reading and filtering data.
// Read & output data
function displayResults(transaction, results) {
for (var i = 0; i < results.rows.length; i++) {
var item = results.rows.items(i);
$('#items').append('<li>' + item.firstName + ' ' + item.lastName + '</li>');
}
}
var db = openDatabase('library', '2.0', 'My library', 5 * 1024 * 1024);
db.transaction(function(t) {
t.executeSql("SELECT * FROM authors", [], displayResults)
});
// Filter data
var db = openDatabase('Library', '2.0', 'My library', 5 * 1024 * 1024);
var lastName = 'Priest';
db.transaction(function(t) {
t.executeSql("SELECT * FROM authors WHERE lastName = ?"
, [lastName], displayResults);
});
Read here: Chapter 16 - Offline Web Applications: Web SQL - Filtering Results.
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Live Sample - Web SQL - Create database, add table, insert, update, delete
Progress: Today was spent completing a proof-of-concept page that does the following.
Read about Web SQL here: Chapter 16 - Offline Web Applications: Web SQL - Working with data.
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Code Samples - Web SQL - Create database, add table, insert, update, delete
Progress: This lesson served as an introduction to Web SQL. It is currently only supported by Safari and Chrome so it is best suited for:
This first lesson consisted of learning how to:
Read about Web SQL here: Chapter 16 - Offline Web Applications: Lesson 1: Web SQL.
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Code Samples - Storage Events
Progress: This lesson covers the StorageEvent object and how to use it to effectively notify other tabs and windows of data changes to local or session storage.
Read about HTML5 storage here: Chapter 15 - Web Storage: Handling storage events.
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson summarizes the key take-aways regarding local and session storage, collectively known as web storage.
I also created some sample code to test various methods regarding local and session storage.
Code Samples - Cookies, Local Storage, & Session Storage
Read about HTML5 storage here: Chapter 15 - Web Storage: Lesson summary.
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson starts by describing the performance pitfalls of some of these storage techniques including size limitations and synchronous-only blocking operations.
It then gets into Google's recommendation for specific storage methods based on browser adoption and performance considerations. These are IndexedDB & Cache API which are used extensively with Service Workers to provide good offline first user experience.
It describes the inherent limitations of other storage methods.
Read about HTML5 storage here: Chapter 15 - Web Storage: Anticipating potential performance pitfalls.
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This discusses and breaks down the different HTML5 storage APIs and how they compare and contrast to old style cookies.
This includes:
deprecated
)deprecated
)Read about HTML5 storage here: Chapter 15 - Web Storage: Understanding HTML5 storage.
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
// IIFE namespace pattern
var namespace = namespace || {};
/* here a namespace object is passed as a function parameter.
* this allows us to assign public methods and properties to it. */
(function( o ){
o.foo = "foo";
o.bar = function(){
return "bar";
};
})(namespace);
Progress: Much of my cert study material puts code right in the global namespace. This is done to keep proof-of-concept code simple and under control but it misses an opportunity to reinforce good coding practices.
Today I took the time to re-write code to get and set cookies using four different namespace patterns from Addy Osmani's Essential JavaScript Namespacing Patterns.
The namespace patterns include:
The notes explaining how to use these four patterns are here: Chapter 15 - Web Storage: Structuring code with Namespace patterns.
Links:
Course Notes - Chapter 15 - Web Storage
Cookie namespace patterns - Code Samples
GitHub Repo - Web Storage GitHub Repo
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This chapter covers Web Storage (localStorage
& sessionStorage
) along with a basic overview of cookies, their use, and their limitations.
This lesson detailed the following.
The live sample can be viewed here: a-cookie-original.html
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson covers polymorphism in JavaScript. It starts with an example of polymorphism in C# and shows how to accomplish the same task with JavaScript.
// Shape object is be the base object
var Shape = function () { };
// Add draw function to the Shape prototype
// Objects derived from Shape will be able to override the draw() method
Shape.prototype.draw = function () {
return "I am a generic shape";
};
// Create a Circle object
var Circle = function () { }
// Make shape the parent for Circle
Circle.prototype = Object.create(Shape.prototype);
// Circle object overrides draw() method
Circle.prototype.draw = function () {
return "I am a circle";
};
var Square = function () { };
Square.prototype = Object.create(Shape.prototype);
Square.prototype.draw = function () {
return "I am a square";
};
var Triangle = function () { };
Triangle.prototype = Object.create(Shape.prototype);
var shapes = [new Shape(), new Circle(), new Square(), new Triangle()];
shapes.forEach(function (shape) {
document.write(shape.draw() + "<br/>");
});
Output
I am a generic shape
I am a circle
I am a square
I am a generic shape
Here are the lesson notes:
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson covers object reflection in JavaScript. In C# reflection allows us to inspect meta data of assemblies, modules, and types. In JavaScript it allows the examination of objects with regards to the object's properties, methods, and inheritance.
var Employee = function (firstName, lastName, gender, email) {
this.firstName = firstName;
this.lastName = lastName;
this.gender = gender;
this.email = email;
}
Employee.prototype.getFullName = function () {
return this.firstName + " " + this.lastName;
}
Employee.prototype.getEmail = function () {
return this.email;
}
Employee.prototype.getGender = function () {
return this.gender;
}
var employee1 = new Employee("Mark", "Matt", "Male", "[email protected]");
for (var property in employee1) {
document.write(property + " : " + employee1[property] + "<br/>");
}
Output
firstName: Mark
lastName: Matt
gender: Male
email: [email protected]
getFullName: function () { return this.firstName + " " + this.lastName; }
getEmail: function () { return this.email; }
getGender: function () { return this.gender; }
Here are the lesson notes:
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson covers abstract classes which cannot be instantiated in an of themselves but rather, act as a base class from which create a sub-class from.
// Create a Shape object which is abstract
var Shape = function () {
this.shapeName = "None";
throw new Error("Cannot create an instance of abstract class");
};
// Add draw function to the Shape prototype
// Objects derived from Shape should be able to call draw() method
Shape.prototype.draw = function () {
return "Drawing " + this.shapeName;
};
// Create a Circle object
var Circle = function (shapeName) {
this.shapeName = shapeName;
};
// Make shape the parent for Circle
// Object.create() allows to create an object without using constructor
Circle.prototype = Object.create(Shape.prototype);
var circle = new Circle("Circle");
// Since Circle inherits from abstract Shape object, it can call draw() method
document.write(circle.draw());
alert(circle instanceof Circle); // Returns true
alert(circle instanceof Shape); // Returns true
Here are the lesson notes:
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson covers the basics of object inheritance in ES5. We do this using a pattern that sets a derived object 's prototype to the base object. This allows the derived object access to the base object's prototype methods and properties.
// Employee will be the base object (Similar to base class in C#)
var Employee = function (name) {
this.name = name;
};
// getName() function is added to the base object (Employee)
Employee.prototype.getName = function () {
return this.name;
};
// PermanentEmployee will be the derived object
var PermanentEmployee = function (annualSalary) {
this.annualSalary = annualSalary;
};
// Use prototype to set Employee as the base object for PermanentEmployee
PermanentEmployee.prototype = new Employee("Mark");
var pe = new PermanentEmployee(50000);
// Derived object (permanentEmployee) can see the
// base object (Employee) getName() method
document.write(pe.getName());
alert(pe instanceof Employee); // Returns true
alert(pe instanceof PermanentEmployee); // Returns true
Here are the lesson notes: Object Oriented JavaScript - Inheritance in JavaScript.
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson covers the process of overriding a function on the prototype object in cases where this behavior is desired.
The lesson covers:
function Employee(name) {
this.name = name;
}
Employee.prototype.getName = function () {
return this.name;
}
function GetEmployeeDetails() {
Employee.prototype.getName = function () {
return this.name.toUpperCase();
}
var e1 = new Employee("Mark");
var e2 = new Employee("Sara");
document.write("e1.name = " + e1.getName() + "<br/>");
document.write("e2.name = " + e2.getName() + "<br/>");
}
GetEmployeeDetails();
Here are the lesson notes: Object Oriented JavaScript - Overriding JavaScript Functions.
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson covers the prototype object and how to add methods you wish to make public to this object in order to limit memory consumption.
The lesson covers:
function Employee(name) {
// public instance field
this.name = name;
}
// Public prototype method
Employee.prototype.getName = function() {
return this.name;
};
var e1 = new Employee("Mark");
var e2 = new Employee("Sara");
document.write("e1.name = " + e1.getName() + "<br/>"); // Mark
document.write("e2.name = " + e2.getName() + "<br/>"); // Sara
Here are the lesson notes: Object Oriented JavaScript - Prototype in JavaScript.
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson covers what a static member is and how to create one. It also discusses when to use this construct.
A static member is a static field (variable) or static method (function). The term static means that there is only ever one copy created in memory for that field or method.
function Shape(shapeName) {
// Instance field
this.ShapeName = shapeName;
// Static field
Shape.Count = ++Shape.Count || 1;
// Static method
Shape.ShowCount = function() {
return Shape.Count;
};
}
var shape1 = new Shape('Circle');
var shape2 = new Shape('Rectangle');
var shape3 = new Shape('triangle');
document.write('Shape.Count = ' + Shape.ShowCount()); // Shape.Count = 3
Five instances of an object can be created from a constructor function but if that constructor defines a static member, only one copy of that member will be created in memory.
Here are more complete examples: Object Oriented JavaScript - Static Members in JavaScript.
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: Today we cover getters and setters in JavaScript. This allows us to control how we update private properties and control what is returned upon request. It provides encapsulation which is one of the four pillars of object-oriented design.
Here is an example in code.
function Employee(name, age) {
var _name = name;
var _age = age;
Object.defineProperty(this, 'age', {
get: function () {
return _age;
},
set: function (value) {
if (value > 100 || value < 1) {
alert("Invalid age");
} else {
_age = value;
}
}
});
Object.defineProperty(this, "name", {
get: function () {
return _name;
}
});
}
You can read a more complete example which includes full code and explanation in my notes on this lesson: Object Oriented JavaScript - Properties in JavaScript.
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson dives deeper into how to create the kind of encapsulation found in traditional class-based inheritance structures of C# and Java.
// JavaScript
function Employee(firstName, lastName) {
// Private Field
var privateFullName;
// Public Fields
this.firstName = firstName;
this.lastName = lastName;
// Private Function
var privateGetFullName = function () {
privateFullName = firstName + " " + lastName;
return privateFullName;
};
// Privileged Function
this.privilegedGetFullName = function () {
return privateGetFullName();
};
// Public Function
Employee.prototype.publicGetFullName = function () {
return this.privilegedGetFullName();
};
}
This lesson covers:
You can read a more complete example which includes full code and explanation in my notes on this lesson: Object Oriented JavaScript - Private members in JavaScript.
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson takes the code scenario posed in the previous lesson and solves for it by creating namespaces. JavaScript does not have namespaces as such but uses objects to accomplish the same kind of encapsulation.
Furthermore, we can create nested namespaces by creating a nested object hierarchy. A nested namespace is a namespace inside another namespace.
var myApp = myApp || {};
var myApp.utilities = myApp.utilities || {};
myApp.utilities.validateData = function(data) {
// some code...
};
You can read a more complete example which includes full code and explanation in my notes on this lesson: Object Oriented JavaScript - Namespaces in JavaScript.
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson details the pitfalls of writing code that lives in the global namespace. Global namespace pollution occurs when we declare variables or functions globally which have the possibility of overwriting code from included libraries or third-parties.
This is most common in large code bases but can occur anytime variables, objects, or functions are being declared globally.
This lesson creates an example of how this can occur.
Notes on this lesson: Object Oriented JavaScript - Global namespace pollution.
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: This lesson gets more in depth with the differences between using literal notation to define a custom object vs using a constructor function to create one.
The lesson shows how an object literal is a singleton, and objects defined with a constructor and the new
keyword are separate individual instances.
// object literal notation
var employee = {
name: "John"
}
// constructor function
var emp = function () {
this.name = "John";
}
// Create an instance of employee
var employee = new emp();
The bottom line is that when we need multiple instances we should use a constructor function. When one instance is needed we can define the object using literal notation.
Notes on this lesson can be found here: Object Oriented JavaScript - Object literal vs. object constructor.
Links:
Project: Study for MS 70-480 Cert Exam (Object Oriented JavaScript)
Progress: Learned about two distinct ways to create custom objects in JavaScript.
The lesson covered code examples of each.
// Constructor function
function Employee(firstName, lastName)
{
this.firstName = firstName;
this.lastName = lastName;
this.getFullName = function () {
return this.firstName + " " + this.lastName;
}
}
var employee = new Employee("Pragim", "Tech");
// Object literal notation
var employee = {
firstName: "Pragim",
lastName: "Tech",
getFullName: function () {
return this.firstName + " " + this.lastName;
}
}
Notes on this lesson can be found here: Object Oriented JavaScript - OOP.
Links:
Project: Reinstall Visual Studio Code & plugins
Progress: Today I decided to wipe clean my Visual Studio Code installation and start fresh. I had many plug-ins installed that were using resources and keeping me from a streamlined coding experience.
I also had quite a few modifications to my user settings, including linting, code formatting, themes, icons, plugin settings, etc.
I did a number of things before a fresh install:
extensions
directory (to clear out old extensions)Code
directory within %UserDir%/AppData/Roaming (to start with a fresh user settings)Once this was done, I proceeded to install the extensions I wanted along with some new ones. Everything runs clean and smooth now.
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This last lesson covered the use of Geolocation API with Google Maps API.
This lesson detailed the following.
options
object for use with the Google Maps APIThe live sample can be viewed here: Position Mapper
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson covered the use of the watchPosition()
method to continuously monitor changes in GPS positioning and call a success function in order to respond to the changes.
This lesson detailed the following.
navigator.geolocation.watchPosition()
method.watchPosition()
's return value watchId
with the clearWatch()
method.The live sample can be viewed here: GPS Watch Position
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
$(document).ready(function() {
getLocation();
});
function supportsGeolocation() {
return 'geolocation' in navigator;
}
function getLocation() {
if (supportsGeolocation()) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
} else {
showMessage("Geolocation isn't supported by your browser");
}
}
function showPosition(position) {
var datetime = new Date(position.timestamp).toLocaleString();
showMessage('Latitude: ' + position.coords.latitude + '<br>' +
'Longitude: ' + position.coords.longitude + '<br>' +
'Timestamp: ' + datetime);
}
Progress: This lesson covers the basics of the Geolocation API which at its most basic returns latitude and longitude positions from which to use with multiple third-party apps and services.
This lesson detailed the following.
navigator.geolocation.getCurrentPosition()
methodgetCurrentPosition()
method. It contains the coords
and timestamp
propertieslatitude
, longitude
, altitude
, accuracy
, altitudeAccuracy
, heading
, & speed
.Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: We finish part 3 of the HTML5 Drag & Drop number scramble game by adding keyboard controls and wrapping up some game functions.
This includes:
scramble()
tile functioncheckForWinner()
functionHere's the completed game: Scramble Game
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: In part 2 of the HTML5 Drag & Drop number scramble game we actually write the bulk of the actual drag and drop code
This includes:
Here's the work in progress: WIP - Scramble Game v2
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: Here we gain experience implementing HTML5 Drag & Drop by building a number scramble game.
The first section covers:
The work in progress page is here : Scramble Game v1
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson got into the DataTransfer object and how to use it to effectively move data from the drag location to the drop location.
This covered:
getData()
, setData()
, & clearData()
dropeffect
, effectAllowed
, files
, and types
drop
eventLinks:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson covered some of the basics behind of Drag and Drop with HTML5. This includes:
draggable
attributedragstart
, drag
, and dragend
)dragenter
, dragover
, dragleave
, and drop
)Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson covered some of the basics behind SVG. This included:
<svg>
, <path>
, and <circle>
elements.svg
file to an <img>
elementLinks:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This completes the lesson on HTML5 <canvas>
element. In the last section we covered:
arc()
method to create circles and circle fragmentsfont
propertyfillText()
and strokeText()
methodsdrawImage()
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson covered lots of areas, including:
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson got into combining fillStyle
with fillRect()
for some interesting drawings.
Specifically covered:
fillStyle
fillStyle
fillStyle
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson covered the use of the <canvas>
element as well as the CanvasRenderingContext2D
object and API.
Also covered:
fillRect()
, strokeRect()
, & clearRect()
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson covered the use of the <video>
and <audio>
HTML elements as well as the HTMLMediaElement
object and API.
Also covered:
<source>
& <track>
elementsLinks:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson covered the use of the WebSocket protocol which establishes a two-way, bidirectional connection between the browser and the web server.
This is done with little overhead (2 bytes) and no headers. The light weight structure of the WebSocket protocol makes is an easy choice for any real-time applications such as chat, gaming, and live content.
Here's a quick bullet list of take-away's:
onclose
, onmessage
, onerror
, and onopen
.readyState
property on the WebSocket object to obtain the state of the connection.ws://
for WebSocket protocol or wss://
for secure WebSocket protocol.Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson covered the use of Web Workers as a non-blocking (async) way of performing work. The worker can send messages back to the spawning task by posting messages to an event handler specified by the creator (calling script). Messages can be any object that can be serialized.
When messages are posted to and from the web worker, the message object is serialized. This creates a copy of the message, so the web worker and the creator never reference the same object.
Web workers also don't have access to the DOM. If something needs to be posted to the DOM then that has to happen in the form of a message sent back to the creator, and the creator must access the DOM as needed.
Here's a quick bullet list of take-away's:
postMessage()
method.postMessage()
method accepts a serializable object.Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: This lesson went into various asynchronous operations using jQuery ajax and jQuery promises. These are still in use as part of the jQuery library but not as modern an implementation as using ES6 Promises with the Fetch API.
Nonetheless, it's still helpful to know these patterns since a huge majority of code-bases are using jQuery's implementation. What was covered is the following:
Links:
Project: Study for MS 70-480 Cert Exam (Programming in HTML5 with JavaScript & CSS3)
Progress: Covered using Ajax to access Web Services created with node.js. The web services were created to use Representational State Transfer (REST) and are also known as RESTful services.
REST attempts to use standard operations of HTTP by mapping create, retrieve, update, & _delete (CRUD) operations to HTTP methods.
The object that makes this call from the browser DOM is the XMLHttpRequest object. It is either invoked directly, or through one of jQuery's many wrapper methods. The ones I used were the following:
Links: AJAX examples on GitHub - These are some XMLHttpRequests() & jQuery $.ajax() methods
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Completed ES6 JavaScript Improved Google Udacity course.
This completes the Google Udacity Scholarship challenge! It took 30 days from start to finish and was exactly the push I needed to stay on track with my 100DaysOfCode challenge.
Now I wait until April 17th to see if I'm selected to complete the remainder of the Mobile Web Nanodegree program!
The lessons covered:
My notes on ES6 JavaScript Improved (4) - Professional Developer-fu.
Links:
Course Notes - Offline First (1) - Introducing the Service Worker
Course Notes - Offline First (2) - IndexedDB and Caching
Course Notes - ES6 JavaScript Improved (1) - Syntax
Course Notes - ES6 JavaScript Improved (2) - Functions
Course Notes - ES6 JavaScript Improved (2.5) - Classes
Course Notes - ES6 JavaScript Improved (3) - Built-ins
Course Notes - ES6 JavaScript Improved (3.5) - Built-ins-Pt2
Course Notes - ES6 JavaScript Improved (4) - Professional Developer-fu.
ES6 JavaScript Improved (free 4 week course) on Udacity
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Continued with my ES6 JavaScript Improved Google Udacity course.
The lessons covered:
My notes on ES6 JavaScript Improved (4) - Professional Developer-fu.
Links:
Course Notes - Offline First (1) - Introducing the Service Worker
Course Notes - Offline First (2) - IndexedDB and Caching
Course Notes - ES6 JavaScript Improved (1) - Syntax
Course Notes - ES6 JavaScript Improved (2) - Functions
Course Notes - ES6 JavaScript Improved (2.5) - Classes
Course Notes - ES6 JavaScript Improved (3) - Built-ins
Course Notes - ES6 JavaScript Improved (3.5) - Built-ins-Pt2
Course Notes - ES6 JavaScript Improved (4) - Professional Developer-fu.
ES6 JavaScript Improved (free 4 week course) on Udacity
Project: Grow with Google Scholarship Challenge: Mobile Web track
// Proxy code
const richard = {status: 'looking for work'};
const handler = {
get(target, propName) {
console.log(target);
console.log(propName);
return target[propName];
}
};
const agent = new Proxy(richard, handler);
agent.status; // (1)logs the richard object, (2)logs the property being accessed,
// (3)returns the text in richard.status
Progress: Continued with my ES6 JavaScript Improved Google Udacity course.
The lessons covered:
My notes on ES6 JavaScript Improved (3.5) - Built-ins-Pt2.
Links:
Project: Grow with Google Scholarship Challenge: Mobile Web track
/*
* Using array destructuring, fix the following code to print the
* keys and values of the `members` Map to the console.
*/
const members = new Map();
members.set('Evelyn', 75.68);
members.set('Liam', 20.16);
members.set('Sophia', 0);
members.set('Marcus', 10.25);
for (const member of members) {
const [key, value] = member;
console.log(key, value);
}
Progress: Continued with my ES6 JavaScript Improved Google Udacity course.
The lessons covered:
My notes on ES6 JavaScript Improved (3) - Built-ins.
Links:
Project: Grow with Google Scholarship Challenge: Mobile Web track
const bowl = {
[Symbol('apple')]: { color: 'red', weight: 136.078 },
[Symbol('banana')]: { color: 'yellow', weight: 183.15 },
[Symbol('orange')]: { color: 'orange', weight: 170.097 },
[Symbol('banana')]: { color: 'yellow', weight: 176.845 }
};
console.log(bowl);
Progress: Continued with my ES6 JavaScript Improved Google Udacity course.
The lessons covered:
My notes on ES6 JavaScript Improved (3) - Built-ins.
Links:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Continued with my ES6 JavaScript Improved Google Udacity course.
The lessons covered:
class
, super
, and extends
keywordsMy notes on ES6 JavaScript Improved (2.5) - Classes.
Links:
Project: Grow with Google Scholarship Challenge: Mobile Web track
// object defaults with object destructuring
function buildHouse({floors = 1, color = 'red', walls = 'brick'} = {}) {
return `Your house has ${floors} floor(s) with ${color} ${walls} walls.`;
}
// tests
console.log(buildHouse());
console.log(buildHouse({}));
console.log(buildHouse({floors: 3, color: 'yellow'}));
// Your house has 1 floor(s) with red brick walls.
// Your house has 1 floor(s) with red brick walls.
// Your house has 3 floor(s) with yellow brick walls.
Progress: Continued with my ES6 JavaScript Improved Google Udacity course.
The lessons covered:
this
keyword with standard functionsthis
keyword with arrow functionsMy notes on ES6 JavaScript Improved (2) - Functions.
Links:
Project: Grow with Google Scholarship Challenge: Mobile Web track
// convert to an arrow function
const squares = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(function(square) {
return square * square;
});
let output = '';
squares.forEach(function(square){
output += ` ${square}`;
});
console.log(output.trim());
const squares = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(square => square * square);
console.log(...squares);
Output: 1 4 9 16 25 36 49 64 81 100
Progress: Continued with my ES6 JavaScript Improved Google Udacity course.
The lessons covered:
...
) operator...
) Rest parameterLinks:
Project: Grow with Google Scholarship Challenge: Mobile Web track
// Object Literal shorthand
let type = 'quartz';
let color = 'rose';
let carat = 21.29;
let gemstone = { type, color, carat };
console.log(gemstone);
// for..of loop
const digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
for (const digit of digits) {
console.log(digit);
}
Progress: Continued with my ES6 JavaScript Improved Google Udacity course.
The lessons covered:
Links:
Project: Grow with Google Scholarship Challenge: Mobile Web track
// Template Literal syntax
var note = `${teacher.name},
Please excuse ${student.name}.
He is recovering from the flu.
Thank you,
${student.guardian}`;
Progress: Continued with my ES6 JavaScript Improved Google Udacity course.
The lesson covered:
let
and const
syntax and when to use eachYou can read more here: My notes - ES6 JavaScript Improved - Syntax.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Started my new Google Udacity course called ES6 JavaScript Improved.
The course is broken down into the following lessons:
this
keyword, classes & subclassesYou can read more here: My notes - ES6 JavaScript Improved - Syntax.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: The final few sections of this course combined all three of the following:
You can read more here: My notes - IndexedDB and Caching - Cache Avatars.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: This section deals with retrieving requested images from local Cache Storage. If the images do not exists locally then a fetch request is made to the network.
Once the image is retrieved, it is displayed to the screen and and saved to cache for future use.
You can read more here: My notes - IndexedDB and Caching - Cache Photos.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: In this section of the course we take the data from the IndexedDB Object Store and write code to display it on the page.
At the same time we create an index and cursor through it to remove any old and stale posts from our database. This makes room for new data that we stream in through web sockets.
You can read more here: My notes - IndexedDB and Caching - Display IDB Data on Page.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: This section consisted of creating an IDB database (wittr) and then writing data to the IDB object store (wittrs).
Once the database was created and populated an index was also created to sort by date.
You can click the link below to read about the process and see the code required to produce the IDB results.
You can read more here: My notes - IndexedDB and Caching - IDB Cache & Display Entries.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: This section of the lesson covered the data that will be save to the IndexedDB Object Store as well as the structure of data.
The process of retrieving existing posts from local storage and then using web sockets to update the feed is also discussed.
Lastly, specifics such as unique index and keys for the data are discussed.
You can read more here: My notes - IndexedDB and Caching - IDB Cache & Display Entries.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: This is the third and final deep dive into IndexedDB fundamentals. Here we cover using cursors and the syntax required to wrap these in Promises rather than nested callback hell. This includes:
You can read more here: My notes - IndexedDB and Caching - IDB Cursors and Indexes.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: This section got into deeper into the IDB API. Some of the items covered were:
Lots of sample code and screen shots for reference.
You can read more here: My notes - IndexedDB and Caching - Diving Deeper with IDB.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Here we got into the code behind IndexedDB. We quickly covered each of the following:
You can read more here: My notes - IndexedDB and Caching.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Learned about IndexedDB and how it can be used by all the major browsers to provide database capabilities. This is a NoSQL rather than relational database and is perfectly suited to persist data related to a site.
This lesson also covers some of the deficiencies inherent in the asynchronous implementations of IndexedDB. It was created before Promises and therefore uses a messy callback architecture.
We look at using a tiny wrapper library written by Jake Archibald which allows us to use Promises rather than events.
You can read more here: My notes - IndexedDB and Caching.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Learned how to trigger a cache and Service Worker update for versioned web content. This provides the user with a notification and creates a new cache store instance separate from the existing cache store.
The versioning of caches stores ensures that the current Service Worker does not experience any interruptions servicing it's pages when new content arrives.
The user is given the option of updating immediately or dismissing the notification and updating with the normal Service Worker lifecycle. This occurs when the old Service Worker is released.
You can read more here: My notes - Triggering an Update.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Learned how to provide the user with an update notification when new content is available through a new Service Worker instance.
When a new Service Worker instance is installed it remains in a 'waiting' state until the current Service Worker is done servicing all pages in its scope and is released. This usually requires navigating off site and back again.
These changes alert the user to new content so they may update with a button click.
You can read more here: My notes - Adding UX to the Update Process.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Learned how to update static cache for a site by creating versioned cache stores.
By changing the name of a cache store from say 'my-app-v1' to 'my-app-v2' we are causing the service worker to spin up a new instance. The new service worker instance gets installed but not activated until the old service worker is released.
We create a separate cache store because we don't want to disrupt the cache that's already being used by the old service worker and the pages it controls.
Once the old service worker is released, we delete the old cache store so the next page load gets the latest resources from the new cache.
You can read more here: My notes - Updating the Static Cache.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Learned the basics of the Cache API for storing offline versions of a site. This includes the use of:
Also learned about the install and activate events of a Service Worker.
Full examples can be found in my notes under - Caching and Serving Assets.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Learned about the following.
fetch
eventsfetchEvent.respondWith()
methodFetch API
as a better and modern alternative to XMLHttpRequest.Here's an example of this kind of event handling.
self.addEventListener('fetch', function(event) {
// TODO: only respond to requests with a url ending in ".jpg"
if ( event.request.url.endsWith( '.jpg' ) ) {
event.respondWith(
fetch( '/imgs/dr-evil.gif' )
);
}
});
Full examples can be found in my notes.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Learned about Chrome Canary, the nightly build of Chrome with bleeding edge features. It can be run along side Chrome Stable but can often break as well. It receives a new feature push almost daily.
Chrome Stable has the Service Worker features already baked in and might be a better choice to test with since it is less likely to crash. That is what I have pictured above.
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Learned about the Service Worker Lifecycle.
This is part of a larger, 3-part Udacity series called Offline Web Applications by Google. It contains the following lessons and is FREE!
Link to Work:
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Learned what the Service Worker is:
But, it does control pages by intercepting requests as the browser makes them.
To see full notes along with screen captures click the link below.
Link to Work: My notes on: Introducing the Service Worker
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Lesson 2: The Benefits of Offline First - Jake Archibald
The Benefits of Offline First course was broken down into 13 segments. It discussed the use of HTTP Cache and laid out a new paradigm which loads content from cache first rather than relying on network connectivity to determine if content gets displayed.
This solves for all three of the following use case scenarios:
Offline First delivers the page (header and/or content) from cache FIRST, and THEN attempts to fetch content from the network.
Lastly, it introduces the Service Worker.
It's billed as a new browser feature and a total game changer- the greatest paradigm shift since asynchronous operations and one that allows you to control the network rather than the network control you.
Project: Grow with Google Scholarship Challenge: Mobile Web track
Progress: Lesson 1: Welcome video.
Welcome video got us set up on the discussion forums, Slack, and basically gave a Scholarship Overview.
Looks like the program is broken up into 10 courses. These are:
Looks like some nice coverage of things I want to dive into deeper!
Project:
Progress: Today was about getting ready to start Round 2! I have created a new R2 repo and log on GitHub and have gone through the Welcome video for my Grow with Google Scholarship: Mobile Web course.
I am excited and ready to jump in with both feet!
Link to work: