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 Promise = require('bluebird'); | |
Promise.longStackTraces(); | |
var A = new Promise(function(pass, fail) | |
{ | |
console.log("A started"); | |
setTimeout(function() | |
{ | |
console.log("A finished"); | |
pass(); |
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'); | |
// dodgy arg parsing | |
var input = process.argv[2]; | |
// import typescript | |
var TypeScript = (function(){ | |
var sandbox = { | |
__filename: __filename, |
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'); | |
// Load the typescript module | |
var TypeScript = (function(){ | |
var sandbox = { | |
__filename: __filename, | |
__dirname: __dirname, | |
global: global, | |
process: process, |
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
// Copyright (C) 2013 Polychrom Pty Ltd | |
// | |
// This program is licensed under the 3-clause "Modified" BSD license, | |
// see LICENSE file for full definition. | |
package com.polychrom.examples; | |
import java.util.concurrent.ExecutorService; | |
import android.app.Activity; |
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 DoubleTap = | |
{ | |
touchStart: function(event) | |
{ | |
this.touched = true; | |
}, | |
touchEnd: function(event) | |
{ | |
if(!this.touched) |
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 mongoose = require('mongoose'); | |
mongoose.connect("localhost", "subdoc_test"); | |
var SubDocSchema = new mongoose.Schema({ foo: String, bar: String }); | |
var mapFrom = function(x) { x.foo = x.abc; x.bar = x.xyz; delete x.abc; delete x.xyz; return x; } | |
var TestSchema = new mongoose.Schema({ | |
values: | |
{ |