Skip to content

Instantly share code, notes, and snippets.

View nesterone's full-sized avatar

Igor Nesterenko nesterone

  • Globallogic
  • Kharkiv
View GitHub Profile
export class CreatePostCommand extends Command {
/**
* Creates a command for adding new post to the system,
* @param {Posts} posts - posts in system
*/
constructor(posts) {
super();
this.posts = posts;
import { NotYetImplementedError } from './NotYetImplementedError';
/**
* Interface for classes that implement Command Pattern
*
* @interface
*/
export class Command {
/**
export class NotYetImplementedError extends Error {
get name () {
return this.constructor.name;
}
}
describe('NumberSumCalculatoin', () => {
it('passed sum calculaton', () => {
expect(new NumberSumCalculation(2, 2).calculate()).toEqual(4);
})
})
/* @todo: #1132:15m/DEV Implement Number Sum Calculation
*
*/
export class NumberSumCalculation implements Calucation<number> {
/**
* Create a number sum calculation.
* @param {number} left - The left value.
* @param {number} right - The right value.
/**
* Represents a generic calculation.
* Allow to go beyound standard language types and operators
*/
export interface Calculation<R> {
/**
* Execute calculation within entities usually provided in constructor
* @return {R} result - calculation result
*/
calculate(): R;
<!DOCTYPE html>
<html>
<head>
<title>My first Vue app</title>
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app">
{{ message }}
</div>
@nesterone
nesterone / .block
Created May 2, 2017 10:06
fresh block
license: mit
import fs from 'fs';
import path, { resolve } from 'path';
import assert from 'assert';
import Module from 'module';
import jsdom from 'jsdom';
import Mocha from 'mocha';
import chokidar from 'chokidar';
// Let's import and globalize testing tools so
// there's no need to require them in each test
<div class="jr-mJoinsDesigner">
<div class="jr-mJoinsDesigner-header">
<div class="jr-mJoinsDesigner-header-leftTable">Left:Table Fields</div>
<div class="jr-mJoinsDesigner-header-operator">Operator</div>
<div class="jr-mJoinsDesigner-header-rightTable">Right:Table Fields</div>
<div class="jr-mJoinsDesigner-header-type">Type</div>
<div class="jr-mJoinsDesigner-header-weight">Weight</div>
<div class="jr-mJoinsDesigner-header-options">Options</div>
</div>
<div class="jr-mJoinsDesigner-dataIslands">