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 Thing = { | |
load: function() { | |
var resolve, reject; | |
function finished() { | |
resolve({}) | |
} | |
function errored() { | |
reject({}); |
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
import {inject, LogManager} from 'aurelia-framework'; | |
import {HttpClient} from 'aurelia-fetch-client'; | |
import _ from 'lodash'; | |
import 'fetch'; | |
const refreshRateInSeconds = 30; | |
@inject(HttpClient, LogManager) | |
export class Users { | |
heading = 'Current Builds'; |
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
// ... | |
config.map([ | |
{route: ['arraytest', 'arraytest/:test'], name: 'test', moduleId: 'arraytest/arraytest', title: 'test'} | |
]); | |
// ... |
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' | |
const router = require('express').Router() | |
const Project = require('../models/project') | |
const Build = require('../models/build') | |
// require('mongoose').Promise = require('bluebird') this is already done elsewhere | |
router.param('projectname', (req, res, next, id) => { | |
if (!id) { |
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
//First way | |
Promise.resolve(userModel.findOneAndUpdate({uid: myUserId}, updatedUserModel, { | |
upsert: true, | |
"new": false | |
}).exec()) | |
.then(function (user) { | |
... | |
}) | |
.spread(function markNotificationsAsRead(unreadNotifications) { | |
... |
NewerOlder