I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| var dom = Bloop.dom; | |
| var Box = Bloop.createClass({ | |
| getInitialState: function() { | |
| return { number: 0 }; | |
| }, | |
| updateNumber: function() { | |
| this.state.number++; | |
| }, |
| (function() { | |
| // Do not use this library. This is just a fun example to prove a | |
| // point. | |
| var Bloop = window.Bloop = {}; | |
| var mountId = 0; | |
| function newMountId() { | |
| return mountId++; | |
| } |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
###Creating a REST API using Node.js, Express, and MongoDB
####Installing Node.js
Go to http://nodejs.org, and click the Install button. Run the installer that you just downloaded. When the installer completes, a message indicates that Node was installed at /usr/local/bin/node and npm was installed at /usr/local/bin/npm. At this point node.js is ready to use. Let’s implement the webserver application from the nodejs.org home page. We will use it as a starting point for our project: a RESTful API to access data (retrieve, create, update, delete) in a wine cellar database.
Create a folder named nodecellar anywhere on your file system. In the wincellar folder, create a file named server.js.
If you rushed through David Shariff's JS Quiz or are just new to JS they might be. I know mine were. After I dried my eyes, I took the quiz again, this time very slowly trying to get at the meat behind each answer. Below is my attempt to explain each question's answer and offer some interesting permutations so that others can move beyond their hurt feelings and come out the other side better JS developers.
I initially thought I'd turn this into a blog post but think it's probably better as a gist.
Don't over think it.
var foo = function foo() {
http://www.thoughtworks.com/radar/#/languages-and-frameworks/683 - ThoughtWorks Technology Radar - January 2014
We continue to see teams run into trouble using JSF -- JavaServer Faces -- and are recommending you avoid this technology. Teams seem to choose JSF because it is a J2EE standard without really evaluating whether the programming model suits them. We think JSF is flawed because it tries to abstract away HTML, CSS and HTTP, exactly the reverse of what modern web frameworks do. JSF, like ASP.NET webforms, attempts to create statefulness on top of the stateless protocol HTTP and ends up causing a whole host of problems involving shared server-side state. We are aware of the improvements in JSF 2.0, but think the model is fundamentally broken. We recommend teams use simple frameworks and embrace and understand web technologies including HTTP, HTML and CSS.
http://www.jfokus.se/jfokus/talks.jsp - Search for JSF... (one hit on why you should leave it)
http://architecture-musings.blo
| /*! | |
| * jQuery JavaScript Library v2.1.1pre | |
| * http://jquery.com/ | |
| * | |
| * Includes Sizzle.js | |
| * http://sizzlejs.com/ | |
| * | |
| * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors | |
| * Released under the MIT license | |
| * http://jquery.org/license |
Forget what you know about Javascript MVC patterns from your experience with Backbone, Ember, Angular, Knockout, Batman, and yada yada. I encourage you to empty your cup, take a step back and open your mind to the ideas presented in the following resources, primarily from minds of Nicholas Zakas and Addy Osmani, two individuals I consider to be thought leaders in the front-end development world.
There was a [great article][1] about how react implements it's virtual DOM. There are some really interesting ideas in there but they are deeply buried in the implementation of the React framework.
However, it's possible to implement just the virtual DOM and diff algorithm on it's own as a set of independent modules.