Sunday 14 February 2016

Jstree & DND Enable Drag and Drop Inside Only

Lesson learned today: To allow drag and drop in the wonderful Jstree, but disable nodes reordering (i.e. allow changing only parent change) you must use:

core : { check_callback : function (op, obj, par, pos, more) {
  if(more.dnd && more.pos !== "i") { return false; }
}
That's as per an answer given by Jstree author himself, Ivan Bozhanov:
https://groups.google.com/forum/#!topic/jstree/nn5GaA6WhXE

Tuesday 8 December 2015

Ability to specify image_name in docker-compose yml file

Update 20/12/2015: It turned put that the team behind Compose is already working on that. There is a pending pull request doing the same in a slightly different way (see details here). This will be part of Compose 1.6.0 release and you should really use that as it will be the officially supported version.


Docker Compose is a great tool for bringing together multi-container application environments with a simple, readable definition file and a single command.

As we have the ability to specify container_name  in the docker-compose.yml file, one logical addition would be to be able to specify the image name of the images built via the build command (generally, the equivalent of running docker build --tag=(tagname) . ).

Normally, auto-generated names in the form of (project)_(name) are totally fine, but it's kind of a pain if you frequently push images built with compose into a registry (as you have to use docker tag manually before pushing those images into the registry).

An example yml file would be:

apikeys:

  build: ./api_keys

  image_name: "dbonev/apikeys"

  container_name: "apikeys"

  ports:

    - "4343:4343"

data_api:

  build: ./data_collection

  image_name: "dbonev/data_api"

  container_name: "data_api"

  ports:

    - "4242:4242"
Using docker-compose up/build on this file would then create an image tagged with dbonev/apikeys, ready to be pushed into the dbonev/apikeys repository.
db@db-VirtualBox:~/node/proton$ docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
dbonev/apikeys       latest              7c8c510b33b9        7 seconds ago       434.1 MB
dbonev/data_api      latest              15537693d7e8        35 hours ago        437 MB
Unfortunately, compose doesn't offer such ability as of the time of this writing. As I am using the tool on a daily basis, I slightly tweaked docker-compose code to allow this.
The image_name branch on my git repo fork of docker-compose does exactly this.

Monday 6 April 2015

Polymorphism with Go

A few days ago I started making my first steps with the Go language. As I am a real newbie in Go, take everything I am going to write here with a (big) grain of salt.

To a large extend, this (and any next posts on Go) reflect my personal journey with the language, from the very basics, to the (hopefully) mastering a new language.

Although Go takes a (few) step(s) away from the traditional object-oriented languages (think Java, Ruby, C#), so far I find it totally possible to write good object-oriented code.

Take for instance polymorphism. The program below show how you can define and execute code that acts much like overridden polymorphic methods. This code also show one very, very nice Go feature -- strong support for composition. Take a close look at how Rect composes a Square within itself, which is basically how we say that a Rect is a Square (well, you can argue that mathematically it's more like the opposite, but it was easier for me to structure the code this way) and as such, all Square's members are automatically accessed via Rect with no call forwarding. This lets us using simply
this.a * this.b
and not
this.Square.a * this.b
although this would also work fine. In other words, syntactically and semantically, it's very similar to what we achieve with inheritance in traditional OO languages.
package main

import (
	"fmt"
	"math"
)

func main(){
	cir := new(Circle);
	cir.rad = 10;
	calc_area(cir);

	square := new(Square);
	square.a = 100;
	calc_area(square);

	rect := new(Rect);
	rect.a = 10;
	rect.b = 50;
	calc_area(rect);
}

// common interface for all shapes
type Shape interface {
	area() float32
}

type Circle struct {
	rad float32
}

// just for convenience square and rectangle are inverted 
// i.e. a rectangle is a square which is probably not that 
// right from purist OO standpoint but makes the code more clear 
type Square struct {
	a float32
}

// rectangle is a square with additional piece of information 
// regarding side
type Rect struct {
	Square
	b float32
}


// 'polymorphic' methods in action
func (this *Circle) area() float32{
	return math.Pi * this.rad * this.rad;
}

func (this *Square) area() float32 {
	return this.a * this.a;
}

func (this *Rect) area() float32 {
	return this.a * this.b;
}

func calc_area(this Shape){
	fmt.Println(this.area());
}


This code produces the following output:


Saturday 6 December 2014

Project: Match -- Find amazing developers and professionals in minutes

Project: Match is a great little service you can use to very quickly find great teams and professionals for your tech projects.

We did this service because we needed it ourselves.

It is all in simplicity and experience. Just type what you needs to be done (in broad terms) and you'll get an email with up to three hand-picked great teams or individuals (depending on the size, complexity and the nature of the task at hand).

So next time when you look for developer, designer or an administrator, why not give it a shot?




Tuesday 28 October 2014

Make a Difference -- One Pizza at a Time

We believe people are fundamentally good.

We also believe in the potential of simple, elegant apps that remove the friction out of real-life processes.

Inspired by the clean simplicity of Push for Pizza, the 'Random Acts of Pizza' subredit and the scientific research on the topic, we were busy the last ten days or so creating Give a Pizza -- a dead simple app, allowing you to buy a pizza to a stranger (or get a pizza from a stranger if you are broke and can't afford it).

We're entering private beta this week. If you're in the U.S. and want to help us a bit, please drop us a line to contact@getqlibri.com to include you in the testing team.















Friday 9 May 2014

Steaming Ahead



These have been really exciting few months.

Our project Qlibri made it into eleven. The first two weeks under the roof were really intense and promising. The atmosphere of this place is simply fantastic, our fellow companies are hands-down great and the mentorship and the advice we've received so far have been nothing less than a pure gold.

The project seems to be on a good track as well, both in terms of product development (we're hopefully releasing a new, important feature in the next 2-3 days), as well as customer development.

Pumped up about the opportunities ahead.

Friday 14 February 2014

Exhausted & Happy

The last two weeks were extremely hectic.
Trying to accomplish so much in so little time was hard (but at the end, very rewarding).

First, the Qlibri app is finally up and running in the AppStore, Google Play and Windows Phone Marketplace. It was really rewarding to finally get all the three apps out there after all the months of hard work.

Second, the team managed to accomplish some quite impressive things on the non-technical development: our twitter, Facebook and Google+ profiles are ready and good to go and we are almost ready with our AngelList page as well.
We had some really useful late-night brainstorming sessions where new ideas popped up, some demo videos were shot and ample amounts of beer were drunk.

Exhausted. But happy.