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 Dialog = function () { | |
... | |
} | |
Dialog.prototype.appendChild = function (item) { | |
item.parentNode = this; | |
this.childNodes.push(item); | |
}; | |
var Button = function () { |
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 (typeof(Name) === 'undefined') { | |
(function(global) { | |
"use strict"; | |
function defineNamespace(object, namespace) { | |
var privates = Object.create(object), | |
base = object.valueOf; | |
Object.defineProperty(object, 'valueOf', { | |
value: function valueOf(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
var SomeKlass = (function () { | |
var privates = Name(); | |
return { | |
public_method: public_method, | |
public_prop: 42, | |
constructor: constructor | |
}; | |
function public_method() { |
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
// optional typing for function parameters | |
// Allows you to use a string literal in front of the variable name | |
// This string literal must be a valid [[Class]] value | |
// And the function when invoked should throw a type error if the argument passed // in doesn't have the correct [[Class]] value | |
// If an argument is not passed in, the function should not throw an error | |
function Func("Function" f, "Array" arr) { | |
return f(arr); | |
} |
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
// bootstrap starts the server, does shit | |
module.exports = function (app) { | |
var routes = readdirSync("/routes"); | |
routes.forEach(function (name) { | |
require("/routes/" + name)(app); | |
}); | |
// MOAR bootstrap | |
// init database connections | |
// configure server |
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 Blog extends Controller { | |
submit() { | |
// logic | |
} | |
} |
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
// super simply snips the current objects [[Prototype]] out of the chain. | |
// It then continues to operate on the object and places that [[Prototype]] back in the chain when | |
// we are done. | |
var Base = { | |
super: function(method) { | |
var _proto = this.__proto__; | |
var args = [].slice.call(arguments, 1); | |
this.__proto__ = _proto.__proto__; | |
try { |
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
{ [Error: getaddrinfo ENOENT] | |
code: 'ENOTFOUND', | |
errno: 'ENOTFOUND', | |
syscall: 'getaddrinfo', | |
error: 'socket', | |
'status-code': 500, | |
scope: 'request', | |
request: | |
{ method: 'PUT', | |
headers: [Object], |
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
error { [Error: getaddrinfo ENOENT] | |
code: 'ENOTFOUND', | |
errno: 'ENOTFOUND', | |
syscall: 'getaddrinfo', | |
error: 'socket', | |
'status-code': 500, | |
scope: 'request', | |
request: | |
{ method: 'GET', | |
headers: |
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 Model = require("./model.js"), | |
error = require("error"), | |
pd = require("pd"); | |
var UserModel = pd.make(Model,{ | |
get: function _get(id, cb) { | |
this.nano.get(id, | |
error.whitelist(function _errors(err) { | |
if (err.syscall === 'getaddrinfo') { | |
UserModel.get(id, cb); |