December 30 2016
- Created and began work on the September page of the blog
- Workshopped CSS on links and navigation
December 29 2016
- Created first draft of navigation from index page
December 28 2016
- Created GitHub repo to set up weekly learning goals
- Added index page to blog
- Learned how pipes can be used to stream data, serve HTML, and serve JSON to a webpage using node
var http = require('http');
var server = http.createServer(function(request, response){
console.log("server was created");
response.writeHead(200, {'content-type': 'text/html' })
var myReadStream = fs.createReadStream(__dirname + '/node.html', 'utf8');// /node.html being filename of the site you want to upload
myReadStream.pipe(response);//sends the data straight to the user
});
server.listen(8000);
December 27 2016
- Youtube videos on bootcamps by a guy at DevMountain and his experience
- Learned how to serve plain text and HTML to the client using Node
- Learned about css resets and why they're necessary
December 26 2016
- Began reading about design patterns. Specifically, the constructor pattern and the module pattern
- Added OOP code to the October page
December 21-25 2016
The week leading up to Christmas was difficult to maintain a strict studying and documenting schedule. I had shopping to do, went to an Eagles tailgate, and visited New York City in the days leading up to Christmas Eve. In no orderly manner I read a variety of blog posts and chapters in books, as well as worked on this site.
- Read about online-offline apps.
- Read another blog post about the event loop.
- Watched a video on timing attacks and how users or clients can attack each other using timers
I returned to the 13 week JavaScript journey that began my path in August
December 20 2016
- Learned about the Event Loop by watching "Philip Roberts: what the heck is the Event Loop anyway?"
- Read Chapter 2: Fundamentals - in Developing Backbone.js Applications - how the MVC design pattern is implemented in Backbone and other JS frameworks
- Model - Holds the data.
- View - This is what is presented to the client. The UI.
- Controller - The events that change the View. The controller processes requests from the browser, asks model for data, and then supplies this data to views.
December 19 2016
- Completed October page on blog
- Learned about github-pages
December 15 2016
- Completed learnyounode exercise HTTP client
- Learned about streams and buffers, and how to read and write streams.
- Reading Streams -similar to fs.readFile but breaks up the data into chunks and allows the client to get the data as the server is still reading it. Instead of waiting for the entire file to be loaded.
- Writing Streams -creates a new file in that directory with the original file's contents.
//HTTP Client
var args = process.argv[2];
var http = require('http');
http.get(args, function(response){
response.setEncoding("utf8");//encodes the response data to a string
response.on("data", console.log(data));//listens to the response, logs the data to the console
response.on("error", console.error(error));//listens to the response, handles any error
}).on('error', console.error);//listens to the http.get, handles any error
var fs = require('fs');
var myReadStream = fs.createReadStream(__dirname + '/nflteams.JSON', 'utf8')
myReadStream.on('data', function(chunk){
console.log('chunk received');
});
var fs = require('fs');
var myReadStream = fs.createReadStream(__dirname + '/nflteams.JSON', 'utf8');
var myWriteStream = fs.createWriteStream(__dirname + '/newteamfile.JSON');
myReadStream.on('data', function(chunk){
console.log('chunk received');
myWriteStream.write(chunk);
});
December 14 2016
- Researched web developers' portfolios and blogs
- Worked on this blog
- Updated the intro paragraph
- Added an October page
- Added headers to each page
- Added some CSS
December 13 2016
- Make it Modular exercise on nodeschool.io
- Read Chapter 6 of HTML & CSS "Tables"
- Added extensive first edits of CSS to this blog, and pushed to GitHub
- Including adding width to coding sections and an overflow scroll
module.exports = function(){
var fs = require('fs');
var path = require('path');
var fileDir = process.argv[2];
var extName = '.' + process.argv[3];
fs.readdir(fileDir, function(err, files){
if(err)
console.log("error");
files.forEach(function(file){ //loop through files
if(path.extname(file) === extName){
console.log(file);//if extname of the file is == extName, log that file.
}
});
})}();
Sterling JV Roster | |||
---|---|---|---|
Name | Number | Position | Year |
Emma Carmody | 00 | GK | Freshman |
Lindsay Naphy | 9 | D | Junior |
Kat Little | 21 | D | Freshman |
Scarlett Donohue | 11 | D | Freshman |
Bella Santa Maria | 15 | MF | Freshman |
Jen Kelly | 7 | F | Sophomore | ...and many more |
December 12 2016
- Node JS tutorial for beginners videos on the V8 engine, the global object, function expressions, modules and require(), module patterns.
If this file is named module.js
var counter = function(arr){
return "There are " + arr.length + "items in the array";
};
var pop = function(arr){
return arr.pop();
}
var sayHi = function(name){
return "Hello there ", name;
}
module.exports.counter = counter;
module.exports.pop = pop;
module.exports.sayHi = sayHi;
This is an example of a modular pattern. In order to access these functions outside of the module, you need to use module.exports and then call its file using require.
And this file is named app.js
var stuff = require("./module");
console.log(stuff.counter(["tea", "mug", "pizza", 7]));
console.log(stuff.pop(["tea", "mug", {}]));
console.log(stuff.sayHi("Gandalf"));
When you run $ node app.js, There are 4items in the array, {}, Gandalf gets logged.
December 10 2016
December 9 2016
- Created this blog!
- Completed Filtered ls exercise on nodeschool.io - learned how to loop through a file directory and return a filtered list of files by their path names.
var fs = require('fs');
var path = require('path');
var fileDir = process.argv[2];
var extName = '.' + process.argv[3];
fs.readdir(fileDir, function(err, files){
if(err)
throw err;
files.forEach(function(file){ //loop through files
if(path.extname(file) === extName){
console.log(file); //if extname of the file is == extName, log that file.
}
});
});
December 8 2016
- Finished watching Ryan Dahl's Nodejs tutorial
- Completed My First Async I/O on nodeschool.io
- Researched potential bootcamps
App Academy seems like the best suited for my situation being that it is in New York City, essentially free ($5000 deposit that they refund + 20% of first year's salary), and has amazing reviews due to a high job placement rate. However, it could be the most selective and difficult to get into.
Launch Academy also sounds tempting, and searches claim they have a campus in Philadelphia which would immediately put it at the top of my list. But their site is only showing Boston and an online option right now, and $15,000 on top of relocating may not be feasible for me at the moment.
More research and introspection needed.
December 7 2016
- Continued reading Node.js chapter in Eloquent Javascript
- Completed My First I/O (synchronous) on nodeschool.io
- Began Node.js (Ryan Dahl) Youtube tutorial
- Learned how to create an http server and read file synchronously and asynchronously
//Creating http server
var http = require('http');
var server = http.createServer(function(request, response){
response.writeHead(200, {'content-type': 'text/plain' })
response.write("empty\n");
setTimeout(function(){
response.end("site\n");
}, 2000)
});
server.listen(8000);
December 6 2016
- Watched ForEach function tutorials
- Began reading Node.js chapter in Eloquent JavaScript
- Began nodeschool.io exercises -completed Hello World and Baby Steps
- Read chapter 5 of HTML & CSS "images"
var arr = [1, 2, 3, 4];
arr.forEach(function(item){
console.log("this is", item);
});//this is item 1
//this is item 2 etc.
December 5 2016
- Finished reading Forms chapter in Eloquent JavaScript
- watched JSON and callback tutorials
December 2 2016
- Read Chapter 4 of HTML & CSS "links"
- Learned how to link to other pages using relative URLs within your own site
- Learned how to href to id tags within a page return to top
- Began Forms chapter in Eloquent JavaScript
December 1 2016
- Read chapter 2 of HTML & CSS "text
- Read chapter 3 "lists" -learned about definition lists
- Read the HTTP chapter in Eloquent JavaScript