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 http = require('http'); | |
| var routes = { | |
| '/foo/.*' : function (req, res) { | |
| res.locals.content = res.locals.content + '<h1>Foo Bar</h1>'; | |
| }, | |
| '/foo' : function (req, res) { | |
| res.locals.content = res.locals.content + '<h1>Foo</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
| // | |
| // NGViewController.h | |
| // TextFieldChanges | |
| // | |
| // Created by James Womack on 2/28/14. | |
| // Copyright (c) 2014 James Womack. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> |
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
| const instanceCount = 2; | |
| var IHaveThePower = function (passedInConfig) { | |
| var config = JSON.parse(JSON.stringify(passedInConfig)); | |
| var okForPublic = {'foo':0, 'bar':0}; | |
| var exports = {}; | |
| function publicize(key) { | |
| Object.defineProperty(exports, key, { |
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 A = function (neighborhood) { | |
| this.neighborhood = neighborhood; | |
| } | |
| A.prototype.getInitial = function () { | |
| return this.neighborhood[0]; | |
| } | |
| A.prototype.getLast = function () { | |
| return this.neighborhood[this.neighborhood.length-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
| function DepartmentStore(name, location) { | |
| var define = Object.defineProperty.bind(undefined, this); | |
| define('title', { | |
| get: function () { | |
| return name.concat(' ', location); | |
| } | |
| }); | |
| define('location', { |
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
| function DepartmentStore(name, location) { | |
| this.getTitle = function () { | |
| return name + ' ' + location; | |
| } | |
| this.setLocation = function (value) { | |
| return location = value; | |
| }; | |
| } |
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
| public class DepartmentStore { | |
| private String name; | |
| private String location; | |
| public DepartmentStore(String someName, String someLocation) { | |
| name = someName; | |
| location = someLocation; | |
| } | |
| public String getTitle() { |
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
| function DepartmentStore() {} | |
| DepartmentStore.prototype = Object.create(Function); | |
| var departmentStore = new DepartmentStore; | |
| console.log(departmentStore instanceof Function); | |
| console.log(departmentStore instanceof DepartmentStore); | |
| /* | |
| true | |
| 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
| function logPIAfterDelay() { | |
| setTimeout(function () { | |
| console.log(Math.PI); | |
| }, 1000); | |
| } | |
| function logPIAfterDelayEval() { | |
| setTimeout("console.log(Math.PI)", 1000); | |
| } |
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 commander = require('commander'); | |
| commander.version('0.0.1').command('new'); | |
| commander.parse(process.argv); | |
| console.log(commander.commands); | |
| var matches = commander.commands.filter(function(c){ | |
| return c._name == commander.args[0]; | |
| }); | |
| if (!matches.length |
OlderNewer