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/bash | |
| ## v1.0.6 | |
| ## this script will gernerate css stats | |
| ### example output | |
| # CSS STATS | |
| # ---------- | |
| # Floats: 132 |
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> | |
| <html> | |
| <head> | |
| <script data-main="usage" src="http://requirejs.org/docs/release/2.1.15/comments/require.js"></script> | |
| </head> | |
| <body> | |
| <p>Check your JavaScript console for output!</p> | |
| </body> | |
| </head> |
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
| /* global module */ | |
| (function() { | |
| "use strict"; | |
| module.exports = function(grunt) { | |
| var shellOptions = { stdout: true, stderr: true, failOnError: true }; |
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> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <title>Localstorage demo</title> | |
| </head> | |
| <script src="Scripts/jquery-2.0.3.min.js"></script> | |
| <script src="Scripts/LocalStorageUtility.js"></script> | |
| <script type="text/javascript"> |
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
| // "Class" like module pattern | |
| (function (NS) { | |
| 'use strict'; | |
| // constructor for the Person "Class", attached to global namespace | |
| var Person = NS.Person = function (name) { | |
| this.name = name; | |
| }; | |
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
| // alternative using 'instanceof' check | |
| (function() { | |
| 'use strict'; | |
| var array = [ | |
| 'l1a', | |
| 'l1b', |
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
| // alternative approach for testing if value is an Object | |
| (function() { | |
| 'use strict'; | |
| var hash = { | |
| level1a: 'l1a', | |
| level1b: 'l1b', | |
| level1c: { |
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
| Prototypal inheritance in JavaScript is described by Douglas Crockford as: you make prototype objects, and then ... make new instances. Objects are mutable in JavaScript, so we can augment the new instances, giving them new fields and methods. These can then act as prototypes for even newer objects. We don't need classes to make lots of similar objects....Objects inherit from objects. What could be more object oriented than that? | |
| http://javascript.crockford.com/prototypal.html |
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
| // Demonstrates the side effects of using 'new' to extend a prototype and the reason to use Object.create (with a shim for IE8 support). | |
| // | |
| // It can be a problem to use 'new' when extending a superclass because you're actually running the superclass's constructor. | |
| // Using Object.create() avoids the problem of unintentional side effects from running the superclass constructor. | |
| // see http://www.objectplayground.com/ for details | |
| // Parent class constructor | |
| function Parent() { | |
| alert("side effect!"); | |
| } |
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
| // constructor | |
| function Person(name) { | |
| this.name = name; | |
| // etc... but no methods here | |
| } | |
| // prototype for all methods, using an IIFE with a returned object for 'public' methods | |
| Person.prototype = (function() { |
OlderNewer