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
| create: function(context, newUser) { | |
| // Initialize all the fields. | |
| const d = new Date().getTime(); | |
| const userToClient = _.assign({ | |
| createdTime: d | |
| }, defaults, newUser); | |
| // Verify that the current user is an admin | |
| isAdminPromise = userService.currentUser(context).then((currentUser) => { | |
| if (get(environment, 'config.clients.user.adminToCreate', true)) { |
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
| eq | |
| [ { total_runtime: 368, | |
| total_step_runtime: 25, | |
| average_step_runtime: 0.00025 }, | |
| { total_runtime: 477, | |
| total_step_runtime: 57, | |
| average_step_runtime: 0.00057, | |
| total_off_baseline: 106, | |
| total_step_off_baseline: 25, | |
| average_step_off_baseline: 0.00024999999999999995 } ] |
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
| import { | |
| createAndPopulateGroup, | |
| generateUser, | |
| } from '../../../helpers/api-integration/v2'; | |
| import { each } from 'lodash'; | |
| describe('POST /groups/:id/invite', () => { | |
| context('user is a member of the group', () => { | |
| each({ | |
| 'public guild': {type: 'guild', privacy: 'public'}, |
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
| funcWithCallback(args, createCallback(obj)); | |
| function createCallback(obj) { | |
| return function (err, data) { | |
| //do stuff with data and obj | |
| } | |
| } |
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
| function! MoveToMiddle() | |
| let end = strdisplaywidth(substitute(getline('.'), '\s*$', '', '')) | |
| let start = indent('.') | |
| call cursor(0, (start + end)/2) | |
| endfunction | |
| map gm :call MoveToMiddle()<cr> |
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
| function getConnection(connectionString) { | |
| return Promise.try(() => { | |
| return mongoose.connect(uri); | |
| }) | |
| .disposer(() => { | |
| mongoose.disconnect(); | |
| }) | |
| } | |
| Promise.using(getConnection(uri), (connection) => { |
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
| User.find({UTCCronTime: hour}) | |
| .each((user) => { | |
| api.getUser(user); | |
| }) | |
| .catch((err) => { | |
| console.log(err); | |
| }); |
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
| 'use strict'; | |
| riot.tag2('cron-time', ' <select onchange="{_update}">\n <option each="{hours}" value="{hour}" __selected="{selected}">{hour}</option>\n </select>\n', '', '', function(opts) { | |
| const self = this; | |
| function range(start, end) { | |
| return Array.apply(Array, Array(1 + end - start)).map((_, i) => { | |
| return i + start; | |
| }); | |
| } | |
| this.hours = range(opts.dayStart + 1, 24).map((hour) => { |
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
| .jumbotron | |
| .container | |
| .visible-xs-block | |
| .center-block | |
| img( | |
| alt="AutoCron" | |
| src="/images/logos/AutoCronLogo.svg") | |
| .title.h1 | |
| | AutoCron | |
| .subtitle.h1 |
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
| 'use strict'; | |
| const expect = require('chai').expect; | |
| describe('foo', () => { | |
| it('should finish', (done) => { | |
| Promise | |
| .reject(new Error()) | |
| .catch(() => expect(false).to.be.true) | |
| .then(() => done(), done); |