- View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
- View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
- HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
- String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Code examples from the article: S.O.L.I.D The first 5 priciples of Object Oriented Design with JavaScript | |
| https://medium.com/@cramirez92/s-o-l-i-d-the-first-5-priciples-of-object-oriented-design-with-javascript-790f6ac9b9fa#.7uj4n7rsa | |
| */ | |
| const shapeInterface = (state) => ({ | |
| type: 'shapeInterface', | |
| area: () => state.area(state) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # only linux and mac | |
| export PATH=~/bin:$PATH | |
| export PATH="/usr/local/mysql/bin:$PATH" | |
| # git bash auto-completion | |
| source `brew --prefix git`/etc/bash_completion.d/git-completion.bash | |
| # latest versions of git has the prompt stuff on an extra file | |
| __git_prompt_file=`brew --prefix git`/etc/bash_completion.d/git-prompt.sh | |
| if [ -f "$__git_prompt_file" ] | |
| then |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Split an array into chunks and return an array | |
| of these chunks. | |
| With kudos to github.com/JudeQuintana | |
| This is an update example for code I originally wrote 5+ years ago before | |
| JavaScript took over the world. | |
| Extending native objects like this is now considered a bad practice, so use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| ** inspired by markgdyr, http://markgoodyear.com/2014/01/getting-started-with-gulp/ | |
| * date:2014年4月14日 | |
| * creator:玄农 | |
| * mail:bocheng.zbc@alibaba-inc.com | |
| **/ | |
| // Load the plugins | |
| var gulp = require("gulp"), | |
| less = require("gulp-less"), |