Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
| Working with DOM | Working with JS | Working With Functions |
|---|---|---|
| Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
| Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
| Create DOM Elements | Conditionals |
#Setting up Nginx on Your Local System ###by Keith Rosenberg
##Step 1 - Homebrew The first thing to do, if you're on a Mac, is to install homebrew from http://mxcl.github.io/homebrew/
The command to type into terminal to install homebrew is:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Table of Contents generated with DocToc
Despite being derived from classical MVC pattern JavaScript and the environment it runs in makes Javascript MVC implementation have its own twists. Lets see how typical web MVC functions and then dive into simple, concrete JavaScript MVC implementation.
Typical server-side MVC implementation has one MVC stack layered behind the singe point of entry. This single point of entry means that all HTTP requests, e.g. http://www.example.com or http://www.example.com/whichever-page/ etc., are routed, by a server configuration, through one point or, to be bold, one file, e.g. index.php.
At that point, there would be an implementation of Front Controller pattern which analyzes HTTP request (URI at first place) and based on it decides which class (Controller) and its method (Action) are to be invoked as a response to the request (method is name for function and member is name for a variable when part of the class/object).
| //TASK | |
| You have an array of numbers. | |
| Your task is to sort ascending odd numbers but even numbers must be on their places. | |
| Zero isn't an odd number and you don't need to move it. If you have an empty array, you need to return it. | |
| //EXAMPLE | |
| sortArray([5, 3, 2, 8, 1, 4]) == [1, 3, 2, 8, 5, 4] |
| --> Focus on FUNCTIONS IN JAVACRIPT | |
| ### Using callbacks in JavaScript (how to pass functions as arguments to other functions) | |
| function doSomethingCool() { | |
| // | |
| } | |
| $('someElement').click( doSomethingCool ); |
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
| "http://www.w3.org/TR/html4/loose.dtd"> | |
| <html> | |
| <head> | |
| <title>JSON Transform</title> | |
| <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script> | |
| <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script> | |
| <script type="text/javascript" src="https://raw.github.com/douglascrockford/JSON-js/master/json2.js"></script> | |
| <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet"></link> |