Skip to content

Instantly share code, notes, and snippets.

View alexeybondarenko's full-sized avatar

Alexey Bondarenko alexeybondarenko

View GitHub Profile
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get install -y mongodb-org
sudo apt-get update -y
@alexeybondarenko
alexeybondarenko / Installations.md
Last active November 22, 2015 15:31
Prepare OSX

##Brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Brew require Xcode Developer Tools. They will be proposed to download. You should agree with it

##Caskroom

@alexeybondarenko
alexeybondarenko / content.md
Last active June 1, 2016 09:13
Credit Service APIs

Кредитные сервисы

Credit365.ua

()[https://credit365.ua/ru/how-to-get]

  • Оформление кредита происходит через личный кабинет
  • Подтверждение телефона и email
  • Заполнение серии и номера паспорта, ИНН
  • Привязка и проверка банковской карты
@alexeybondarenko
alexeybondarenko / Makedonia Forza API.md
Last active June 13, 2016 12:37
Makedonia API CURL samples

get product info

curl 'http://circeo.nebo15.com/DFI_MK/presales/web/product/bulkcalculation/presalesConfigurationProcess/paydayLoanOffer' -H'Accept: application/vnd.kolkida.loanfactory.presales.FetchBulkCalculationQuery+json'
{
    "result": "{\"commercialOfferConfigurationKey\":\"543a432e-4d99-4168-8021-b0377de57cf2\",\"rules\":[{\"MoneyRange\":{\"min\":\"1000.00 MKD\",\"max\":\"10000.00 MKD\",\"step\":\"1000.00 MKD\",\"property\":{\"componentKey\":\"loanAmount\",\"parameterName\":\"amount\"}}},{\"PeriodRange\":{\"min\":\"P30D\",\"max\":\"P180D\",\"step\":\"P5D\",\"property\":{\"componentKey\":\"paydaySchedule\",\"parameterName\":\"length\"}}}],\"resultProperties\":[{\"name\":\"mergeSchedules_firstInstallment\",\"type\":\"Money\"},{\"name\":\"APR_result\",\"type\":\"InterestRate\"}],\"labels\":{\"loanAmount_amount\":[{\"locale\":\"en-US-x-lvariant-lf\",\"message\":\"Loan Amount\"}],\"mergeSchedules_firstInstallment\":[{\"locale\":\"en-US-x-lvariant-lf\",\"message\":\"Amount to pay\"}],\"p
@alexeybondarenko
alexeybondarenko / midi-api_step1_server.js
Last active August 8, 2017 20:23
Tutorial. How to create MIDI synthesizer with MIDI API and Node JS
const Express = require('express');
const ejs = require('ejs');
const path = require('path');
const app = new Express();
app.set('PORT', process.env.PORT || 3000);
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, './views'));
(function() {
'use strict';
console.log('App is running');
var midiAccess = null;
navigator.requestMIDIAccess().then(onMidiAccessSuccess, onMidiAccessFailure);
function onMidiAccessSuccess(access) {
midiAccess = access;
// WEBSOCKETS
var socketUrl = 'ws://' + location.hostname + ':3001';
var client = new BinaryClient(socketUrl);
var MIDIStream = null;
client.on('open', function () {
MIDIStream = client.createStream();
MIDIStream.on('data', handleReceiveAudioData);
MIDIStream.on('end', handleEndAudioStream);
});
function handleReceiveAudioData(data) {
function handleMidiMessage(e) {
console.log(e);
if (!MIDIStream || e.data[0] !== 0x90) return;
MIDIStream.write(e.data);
}
const binaryServer = require('binaryjs').BinaryServer;
const socket = new binaryServer({
port: 3001,
});
socket.on('connection', (client) => {
client.on('stream', (stream, meta) => {
stream.on('data', (data) => {
console.log(data);
const socket = new binaryServer({
port: 3001,
});
function playTone(tone, stream) {
if (tone > 61 || tone < 1) {
console.log('undefined tone', tone);
return;
}
const filePath = path.resolve(__dirname, 'wav', `${tone}.wav`);