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
| var pojo = function () { | |
| var members = arguments | |
| , ctr = 0 | |
| return function () { | |
| var obj = {} | |
| , i = 0 | |
| , len = members.length | |
| ctr += 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
| var classifyShape = function(shape) { | |
| var isTriangle = function() { | |
| console.log('A triangle is a polygon with 3 sides.') | |
| } | |
| var isQuadrangle = function() { | |
| console.log('A quadrangle is a polygon with 4 sides.') | |
| } |
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
| var Metalsmith = require('metalsmith') | |
| , markdown = require('metalsmith-markdown') | |
| , templates = require('metalsmith-templates') | |
| , Handlebars = require('handlebars') | |
| , fs = require('fs') | |
| , collections = require('metalsmith-collections') | |
| , permalinks = require('metalsmith-permalinks') | |
| Handlebars.registerPartial('header', fs.readFileSync(__dirname + '/templates/partials/header.hbt').toString()) | |
| Handlebars.registerPartial('footer', fs.readFileSync(__dirname + '/templates/partials/footer.hbt').toString()) |
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
| /* | |
| Sample IIFE + Augmentation | |
| Here I created a module counter, | |
| and augmented it (added reset function). | |
| */ | |
| var counter = (function() { | |
| var count = 0 | |
| return { |
NewerOlder