Pixelhunter.me

The most evident programming bits hunted by Dmitri Voronianski. Not a multicolored stencil. Nor a camera and a crew.

Simple shell script + PM2 deployer

I’m a big fan of docker and especially dokku technology. Together with DigitalOcean they make a perfect fit and simplify product shipping process a lot while making it as easy as running:

app:~$ git push production master

But sometimes you’re faced with the problem of managing several Node.js application on one server that were already setup to use bash scripts and probably you want to utilize the full power of PM2 process manager as well.

Read More

Getting started with Melchior.js

As you may know Require.js is probably the most wide spread JavaScript module loader that is used for browser development nowadays. Everybody knows that in some ways Require (and AMD) sucks, especially when we are talking about the long lines of code dependencies that you need to declare and to write your module names twice:

define(['dep1', 'dep2', 'dep3', 'dep4', 'dep5'], function (dep1, dep2, dep3, dep4, dep5) {
    return function () { ... };
});

Personally I prefer CommonJS style and that’s where the idea behind Melchior.js is starting from. If you know the trick you can achieve something similar with Require.js too:

define(function (require) {
    var dep1 = require('dep1');
    var dep2 = require('dep2');
});

But that was not enough for us and we came up with the idea of "Chainable Module Definition" to add some structure and make simplicity of method chaining to work for you in the browser when just creating modules or loading scripts.

melchiorjs.module('name')
.require('dep1')
.require('dep2')
.body(function () { ... });

Before we start the guide I need to mention that Melchior.js is not production ready yet but it’s fine enough to play with.

Read More

Slim progress bars for Angular.js applications with ngprogress-lite.js

At first demo - I think most of us saw trickle loading bars on such popular services as Youtube or Medium, isn’t it?

Nprogress.js is an original jQuery plugin that popularized such loading effect. Unfortunately I noticed that there were no similar stable modules for Angular.js applications.

I didn’t want to add additional bytes of jQuery to my project just because of that reason and that’s why I created a port of nprogress.js for Angular.js - ngprogress-lite.js.

To start using you just need to inject provider inside your angular module and start calling methods inside your controllers, services or directives:

var app = angular.module('example', ['ngProgressLite']);

app.controller('MainCtrl', function (ngProgressLite) {
  ngProgressLite.start();
  
  setTimeout(function () {
    ngProgressLite.done();
  }, 1500);
});

You can check the result once more here and read documentation inside github repository. Also I would like to add that it’s highly customizable (including templating), as well as it has the same API as original jQuery dependent solution.

Vote for Streamlikes - hack entry for Node Knockout 2013 competition

Last weekend I participated in Node Knockout online hackathon. The voting is currently going on, so I would like to present my small hack here.

Streamlikes was planned as a radio for recent popular tracks and mixes of your favorite bands and artists. Unfortunately I didn’t have enough time to finish everything, but it already works in a way by getting likes from Facebook Graph API, and streaming shuffler.fm tracks suggestions with HTML5 Web Audio API.

I suppose that all technical details and some inputs about the competition itself will be put in a separate article soon. So keep in touch!

And please vote for Streamlikes simply by clicking the button at the bottom of the page! Thanks! ;)

UPDATE (Dec 14, 2013): Finally competition is over and winners announced! My entry finished in Top 100 overall and took 13th and 14th place in Solo and Design categories respectively. Thanks everyone who was voting for Streamlikes! For now I won’t proceed with app’s development because of the lack of time and it will present on Joyent’s competition server as long as it will be possible.