Skip to content

Instantly share code, notes, and snippets.

View child-component.js
import { fixNeeded } from './iife';
console.log(fixNeeded) // true;
View TableFormatter.js
/**
* Created by iashindmytro on 3/15/17.
*/
import React, { Component, PropTypes } from 'react';
import { NO_TABLE_DATA } from 'constants';
import {openAIModal} from 'AC/agentInfo';
import { getLang } from 'reducers/settings';
import alignDir from 'decorators/TableHeaderColumn';
import { agentTooltipDetailsForLogsTable } from 'components/common/Tooltip/agentTooltipDetails';
View week-view.component.ts
const events = group.events;
const aggregatedRanges = [ new AggregatedRange(events[0]) ];
for (let i = 1; i < events.length; i++) {
const range = aggregatedRanges[aggregatedRanges.length -1];
const event = events[i];
if (event.data.start < range.end) {
range.events.push(event);
View week-view.component.ts
static calculateEventsWidth(groupedEvents) {
groupedEvents.forEach((group: EventModel[]) => {
const interactions = [];
let topRange = group[0].data.end;
let currentInteractionStart = 0;
let currentInteractionCount = 0;
group.forEach((event: EventModel, idx: number) => {
let nextEvent = group[idx +1];
@dimaShin
dimaShin / form-controller.js
Created Mar 18, 2016
ngFormController decorator
View form-controller.js
;(function (ng) {
FormControllerDecorator.$inject = ['$delegate', 'Helpers'];
function FormControllerDecorator ($delegate, helpers) {
const ngForm = $delegate[0];
const FormController = ngForm.controller;
FormController.prototype._errorMessages = helpers.errorMessages;
View gist:b82bc7b27299f2b390ad
Counter.prototype.del = function(target){
var self = this;
var tr = $(target).closest('tr');
var undo = tr.find('.undo-button');
undo.css('display', 'block');
undo.one('click', function () {
clearTimeout(timeout);
undo.css('display', 'none');
})
View angular-summernote.js
.directive('summernote', [function() {
'use strict';
return {
restrict: 'EA',
transclude: 'element',
replace: true,
require: ['summernote', '?ngModel'],
controller: 'SummernoteController',
scope: {
View gist:cbc0277e097df9ba1dbf
function middleware(username, password, done) {
superagent
.post('https://nixenterprise.nixsolutions.com:4433/services/TokenService.svc/GetToken')
.send({login: username, password: password})
.type('json')
.end(function(err, res) {
if (err || res.body.status === 'Fail') {
return done(err || res.body.status)
}