- http://lostechies.com/derickbailey/2012/06/04/anders-hejlsberg-is-right-you-cannot-maintain-large-programs-in-javascript/
- http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
- http://en.wikipedia.orgi/wiki/Separation_of_concerns
- Single Responsibility Principle: http://www.objectmentor.com/resources/articles/srp.pdf
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
| define(function(){ | |
| //just so we can check against undefined and set val as undefined | |
| var UNDEF; | |
| // here you create the "interface", trying to get/set any other property | |
| // will throw errors before build (see pragmas on get). | |
| var _data = { | |
| foo : UNDEF, | |
| bar : UNDEF, |
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
| // Combine JS and CSS files | |
| // --- | |
| // | |
| // Make sure you install the npm dependencies | |
| // > cd YOUR_PROJECT_FOLDER | |
| // > npm install | |
| // | |
| // Than run: | |
| // > node build |
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
| /* | |
| * Karl Westin | |
| * Part of the "refactoring javascript for unit testing" blog post | |
| * --- | |
| * Quick refactor by Miller Medeiros (http://blog.millermedeiros.com) | |
| * Didn't tested the code during/after changes, might contain errors. | |
| */ | |
| function Lightbox(parent) { |
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
| DirectoryIndex index.html index.htm index.php | |
| ErrorDocument 404 /404 | |
| # Block directory listing | |
| Options -Indexes | |
| # === URL Rewrite === # | |
| # Map all URIs except those corresponding to existing files/folders to the handler | |
| RewriteEngine on |
- Yahoo Performance Rules
- Um dos primeiros sites a divulgar esse tipo de info e provavelmente o mais famoso.
- Google Web Performance Best Practices
- Similar ao Yahoo Perf Rules.
- Sitepoint web site optimization steps
- Similar ao yahoo mas entra em mais detalhes sobre implementação.
- Performance Calendar
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
| // | |
| // find closest number in the sequence (1, 5, 10, 50, 100, 500, 1000, ...) | |
| // that generates less than "n" steps | |
| // --- | |
| // useful for subdividing charts and any other things that requires a scale | |
| // that follows reasonable numbers | |
| // | |
| function getStepSize(val, maxNSteps) { | |
| var nSteps; | |
| var stepSize = 1; |
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
| <!DOCTYPE html> | |
| <!-- #include "inc_header.html" title="Example" header="Sample Title" --> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Example</title> | |
| <link rel="stylesheet" href="css/main.css"> | |
| </head> | |
| <body> | |
| <h1>Sample Title</h1> |
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
| // If OOP is "your thing" it can be easily abstracted into a constructor | |
| define( | |
| [ | |
| 'amd-utils/array/insert', | |
| 'amd-utils/array/remove', | |
| 'amd-utils/array/contains', | |
| 'amd-utils/array/forEach' | |
| ], | |
| function (insert, remove, contains, forEach) { |
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
| #!/bin/sh | |
| # This shell script is used to bootstrap the app and update external libraries | |
| # | |
| # ====== IMPORTANT ====== | |
| # | |
| # it may break application if 3rd party libs aren't backwards compatible | |
| # or if libs were edited locally, use with care !!! |