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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 pow(x, n) { | |
let result = x; | |
for (let i = 1; i < n; i++) { | |
result *= x; | |
} | |
return result; | |
} | |
function fractionMutable(parts, accuracy = 3) { | |
if (parts.length > 5e6) { |
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 fractionMutable(parts) { | |
let acc1 = 0; | |
let acc2 = 0; | |
let acc3 = 0; | |
let correction = 0; | |
let part; | |
// Сумма долей в acc1 | |
for (let i = 0; i < parts.length; i += 1) { | |
part = parseFloat(parts[i], 10); |
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
const cache = new Map(); | |
const getBondsData = async ({ date, isins }) => { | |
const cacheKey = isin => `${date}_${isin}`; | |
const requestIsins = isins.filter( | |
isin => !cache.has(cacheKey((isin)) | |
); | |
const request = http.post({ |
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
const getLogger = () => { | |
debugger | |
document.body.innerHTML = `<div id='console'></div>` | |
const console = document.getElementById('console'); | |
return (message) => { | |
const d = document.createElement('<pre>'); | |
d.innerHTML = JSON.stringify(message, null, 2); | |
console.appendChild(d); | |
} |
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
$(node).animateCustom('move', {duration, stageDelay}) | |
.active(t => { | |
this.css({ | |
top: Math.round(fromTop + (toTop - fromTop) * t) + 'px', | |
left: Math.round(fromLeft + (toLeft - fromLeft) * t) + 'px', | |
}); | |
return true; | |
}).done(() => { | |
this.css({ | |
top: toTop + 'px', |
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 (window, $, irr) { | |
var layout = irr.Tools.Layout; | |
var extend = irr.Tools.extend; | |
var MIN_DELAY = 30; // минимальная задержка между стадиями анимации, мс | |
// [Функции затухания](https://github.com/danro/jquery-easing/blob/master/jquery.easing.js): |
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
var path = require('path'); | |
var cluster = require('cluster'); | |
var bootable = require('bootable'); | |
var bootableEnv = require('bootable-environment'); | |
var spdy = require('spdy'); | |
var keys = require('spdy-keys'); | |
var koa = require('koa'); | |
var app; | |
if (cluster.isMaster) { |
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
/** | |
* Auto propagate fixup in descendant branches. | |
* Created by a.koperskiy on 18.06.15. | |
*/ | |
require('colors'); | |
var co = require('co'); | |
var nodegit = require("nodegit"); | |
var Repository = nodegit.Repository; |