Skip to content

Instantly share code, notes, and snippets.

View kriskowal's full-sized avatar

Kris Kowal kriskowal

View GitHub Profile
var Q = require("events");
exports.and = function (a, b) {
return Q.when(a, function (a) {
return Q.when(b, function (b) {
return a && b;
});
});
};
var app = function (request) {
return {
"status": 200,
"headers": {"Content-type": "text/plain" },
"body": ["Hello, World!\n"]
};
};
var app = function (request) {
exports.ContentLengthMiddleware = function (app) {
return function (request) {
return Q.when(app(request), function (response) {
var stream = new ByteIO();
var write = function (line) {
stream.write(line.toByteString("utf-8"));
};
return Q.when(response.body.forEach(write), function () {
var content = stream.read();
// EXAMPLE 1
// PSGI equivalent
var app = function(env) {
return function(respond) {
// do some event stuff
setTimeout(function() {
respond({ status : code, headers : headers, body : body });
}, 1000);
}
using System;
namespace Pastebin
{
class Pbcopy
{
[STAThread]
static void Main(string[] args)
{
try
+ Running
+ Running test sputnik/15.9.2_The_Date_Constructor_Called_as_a_Function/S15.9.2.1_A1.js
+ Running test sputnik/15.9.2_The_Date_Constructor_Called_as_a_Function/S15.9.2.1_A2.js
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T1.js
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T2.js
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T3.js
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T4.js
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T5.js
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T6.js
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A2_T1.js
+ Running
+ Running testReflexiveParseFormat 2010-01-01T00:00:00.000Z
+ Running testNonReflexiveParseFormat 2010
+ Running testNonReflexiveParseFormat 2010-01
+ Running testNonReflexiveParseFormat 2010-01-01
+ Running testNonReflexiveParseFormat 2010-01-01T00:00Z
+ Running testNonReflexiveParseFormat 2010-01-01T00:00:00Z
+ Running testNonReflexiveParseFormat 2010-01-01T00:00:00.000Z
+ Running testNonReflexiveParseFormat 2010-01-01T00:00:00.000+01:01
+ Running testNonReflexiveParseFormat 0010
var SYSTEM = require("system");
var allInput = SYSTEM.stdin.read();
SYSTEM.stdout.write("someOutput");
var FS = require("fs");
FS.write("path/to/file", "allOfFileData");
var allOfFile = FS.read("path/to/file");
function genericLoad(id, baseId) {
id = resolve(id, baseId);
let text = fetch(id);
return new Function("require", "exports", "module", text);
}
let memo = {};
function genericRequire(id, baseId) {
id = resolve(id, baseId);
var delay = function (timeout) {
var deferred = new Deferred();
setTimeout(function () {
deferred.resolve();
}, timeout);
return deferred.promise;
};
delay(1000).then(function () {