This file contains 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
footer, footer::before, footer::after { | |
height: 342px; | |
} | |
footer { | |
background-image: url(../images/footer-center.png); | |
background-position: center top; | |
background-repeat: no-repeat; | |
bottom: 0; | |
left: 0; |
This file contains 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
"use strict"; | |
var Q = require("q"); | |
module.exports = function fromEventEmitter(ee) { | |
var deferred = Q.defer(); | |
ee.on("success", deferred.resolve); | |
ee.on("error", deferred.reject); | |
return deferred.promise; |
This file contains 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
"use strict"; | |
var restify = require("restify"); | |
var users = require("./users"); | |
// The users module will have a getAuthorizationFromAccessTokenAsync promise-returning export. (Convert to callbacks if you wish). | |
// It rejects in cause of not authorized, or fulfills with a { scope, customerId } object if the user is authorized. | |
// The scope property indicates which scopes the user corresponding to a given access token has. | |
module.exports = function authPlugin(serverRequest, serverResponse, next) { |
This file contains 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 mockHttp = require("mock-http"); | |
var a = mockHttp.server.request().errorsWith(new Error()); | |
var b = mockHttp.server.request().respondsWith(mockHttp.response.errorsWith(new Error())); | |
var c = mockHttp.server.request().respondsWith("string"); | |
var d = mockHttp.server.request().respondsWith("string", headersHash); | |
var A = mockHttp.server.response("text of response", optionalHeadersHash); | |
var B = mockHttp.server.response().data("text").error(new Error()); | |
var C = mockHttp.server.response().data("text").data("more text"); |
This file contains 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
"use strict"; | |
// Essentials of prototypes: | |
var carProto = { | |
drive: function () { | |
console.log("driving a " + this.color + " car"); | |
} | |
}; |
This file contains 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> | |
<!-- File > New Project > Templates > JavaScript > Blank App; replace default.html with this --> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>App2</title> | |
<!-- WinJS references --> | |
<link href="//Microsoft.WinJS.1.0.RC/css/ui-dark.css" rel="stylesheet" /> | |
<script src="//Microsoft.WinJS.1.0.RC/js/base.js"></script> |
This file contains 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
"use strict"; | |
// `f` is assumed to sporadically fail with `TemporaryNetworkError` instances. | |
// If one of those happens, we want to retry until it doesn't. | |
// If `f` fails with something else, then we should re-throw: we don't know how to handle that, and it's a | |
// sign something went wrong. Since `f` is a good promise-returning function, it only ever fulfills or rejects; | |
// it has no synchronous behavior (e.g. throwing). | |
function dontGiveUp(f) { | |
return f().then( | |
undefined, // pass through success |
This file contains 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 fs = require("fs"); | |
var path = require("path"); | |
var wrench = require("wrench"); | |
var BOM_CHAR_CODE = 65279; | |
var BOM = String.fromCharCode(BOM_CHAR_CODE); | |
var fileNames = wrench.readdirSyncRecursive(process.cwd()).filter(function (fileName) { | |
return path.extname(fileName) === ".js"; | |
}); |
This file contains 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> | |
<title>ES5 Data Binding Proof of Concept</title> | |
</head> | |
<body> | |
<section> | |
<label> | |
Name: | |
<input data-bind="name" type="text" /> |
This file contains 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
{ | |
"name": "cool-app-from-work", | |
"description": "Any identifying information has been anonymized.", | |
"version": "1.0.0-beta.3", | |
"author": "Our Org", | |
"private": true, | |
"repository": { | |
"type": "git", | |
"url": "https://github.com/our-org/our-app" | |
}, |