Skip to content

Instantly share code, notes, and snippets.

View lislon's full-sized avatar

Igor Golovin lislon

View GitHub Profile
/**
* Safely access to a variable value using dot notation 'loan.city.name'
*
* @param {Object} locals Temlate variables
* @param {String} dotPath Path to a variable, for ex. 'loan.city.name'
* @param {String} defValue Fallback value
* @return {Mixed}
*/
safeVar: function(locals, dotPath, defValue) {
var value = _.reduce(dotPath.split('.'), function(res, token) {
#!/usr/bin/env node
'use strict'
var common = require('../.')
common.derp.db.init({models: common.models}).connect(common.settings.db.uri, function(err) {
console.log("done");
})
Noti.sendSuccessOrderLoan = function(loanOrder, cb) {
email.send('success-order-loan', loanOrder, {}, cb)
}
var page = require('webpage').create();
page.onResourceRequested = function(request) {
console.log('Request ' + JSON.stringify(request.url, undefined, 4));
};
page.onResourceReceived = function(response) {
//console.log('Receive ' + JSON.stringify(response.url, undefined, 4));
};
page.open('http://local.ros-dengi.ru', function(status) {
"use strict"
var chai = require('chai'),
assert = chai.assert,
expect = chai.expect,
webdriverio = require('webdriverio');
describe('Loan order process', function(){
this.timeout(99999999);
var client = {};
before(function(done){
client = webdriverio.remote({ desiredCapabilities: {browserName: 'firefox'} });
div
strong Контактные лица:
{{#each contacts}}
div {{this.firstname}} {{this.middlename}} {{this.lastname}}
div Кем приходится: {{this.relationship}}
div Телефон: {{this.phone}}
br
{{/each}}
"use strict"
process.env.NODE_ENV = 'testing'
process.env.PORT = '8001'
process.env.DIR_PUBLIC = __dirname + '/../public'
var chai = require('chai'),
assert = chai.assert,
expect = chai.expect,
webdriverio = require('webdriverio'),
client.addCommand("waitForFunc", function(checker, timeout) {
if (typeof timeout === 'function') {
cb = timeout
timeout = this.options.waitforTimeout
}
return new Promise(function(fulfill, reject) {
var start = new Date().getMilliseconds()
var timer = setTimeout(function run() {
if (!checker()) {
if (new Date().getMilliseconds() > start + timeout) {
"use strict";
var service = module.exports = {},
derp = require('derp'),
async = require('async'),
randomstring = require('../util/randomstring'),
_ = require('lodash')
;
// services
_addViewListeners: function () {
var loanCalc = this;
this.listenTo(this.view, 'create:order:loan', function () {
loanCalc.trigger('create:order:loan', {
amount: this.model.get('amount'),
term: this.model.get('term'),
totalSum: this.model.get('totalSum'),
repayDate: this.model.get('repayDate'),
})
})