Skip to content

Instantly share code, notes, and snippets.

View rozanovz's full-sized avatar

Alexey Rozanov rozanovz

View GitHub Profile
{
"card":{
"description":"TD-TR-06",
"name":"T7.5/T8.5 - Weekly Trading Report - exc VAT 2014/15 FY + Summary",
"subType":"table",
"rangeName":"prevFiscalYear",
"selectedTotals":[
],
"type":"table",
{
"card": {
"description":"TD-TR-06",
"name":"T7.5/T8.5 - Weekly Trading Report - exc VAT 2014/15 FY + Summary",
"subType":"table",
"rangeName":"prevFiscalYear",
"selectedTotals":[],
"type":"table",
"yAxis": {
"label": "Label", "type": "Label", "symbol": null
{
"card": {
"description":"TD-TR-03",
"name":"T5/T6- Weekly Trading Report - exc VAT Last Week",
"subType":"table",
"rangeName":"prevWeek",
"selectedTotals":[],
"type":"table",
"yAxis": {
"label": "Label", "type": "Label", "symbol": null
{
"id":11579,
"createdBy":"AdminTD@monicavinader.com",
"name":"Web USA (Inc VAT)",
"description":null,
"fromDate":1443657600000,
"toDate":1459468799000,
"multipleAxis":true,
"showGroupingAsPercentage":false,
"showTableTotals":true,
fib = function(numMax){
var counter = 0,
i = 1,
j = 1;
for (var k = 0; k < numMax; k++) {
if ((Math.max(i,j) % 2) !==0)
counter++;
x = i + j;
i = j;
//аджакс запрос на сервер, реализованный в ес6/7, возвращает промис
//в данном случае при успешном ответе с сервера (200) - вернет нам статус из ответа с сервера
//в случае ошибки - выведет в консоль ошибку
//.then(function(res){return res.status},function(err){console.log(err)});
//так бы выглядили наши функции если бы мы писали их на ес5
//в данном случае мы сразу к промису привязываем then, и возвращаем данные которые нам вернет сервер
var p = fetch('/foo')
.then(res => res.status, err => console.error(err))
//тут по отдельности обрабатываем уже то что вернулось промиса обращаясь к нему как к переменной
(function (){
angular.module('liraApp', ['ngRoute', 'ngSanitize']);
function config ($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
templateUrl: 'home/home.view.html',
controller: 'homeCtrl',
controllerAs: 'home'
getRandomColor() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
if (ui.item.sortable.dropindex !== undefined) {
let positions = [];
ui.item.sortable.sourceModel.forEach((metric, index) => {
positions.push({cardMetricRelationId: metric.relationId, position: index + 1});
});
this.cardBuilder.loading = true;
return this.card.metrics.updatePositions(positions).then(() => {
Error: { [Error: getaddrinfo ENOTFOUND uit.truedash.com uit.truedash.com:443]
code: 'ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'uit.truedash.com',
host: 'uit.truedash.com',
port: 443 }
Error: { [Error: getaddrinfo ENOTFOUND uit.truedash.com uit.truedash.com:443]
code: 'ENOTFOUND',
errno: 'ENOTFOUND',