11ec30dedeb7889af512461ba7ce6a45

How we built Ruby PaaS - Part I: Overview of our stack

I would like to share with you the details of how we built Shelly Cloud, our platform for hosting Ruby applications, and how it works.

This is the first post of the series on our blog, in which I'll present you with an introduction to the company and an overview of our stack.

Continue reading
3254f15ea674eb387b83ebc59253a97d

Chef best practices

Chef is a framework written in Ruby, and partially in Erlang (Chef Server). It provides an API for numerous system services. With Chef, your infrastructure can be expressed as object-oriented code that is versionable, testable, and repeatable. One of the main ideas of Chef developers was to bury the walls that exist between software development and system administration, allowing them to bring system configuration to a higher level.

Continue reading
40716cc1589577b8eb672d97953c264f

Binding Objects in Forms with Ember for Fun and Profit

Ever run into the situation where you had to perform some operation based on the value from select field? How did you handle it? Maybe multiple case / switch statements? Or if you are lucky enough and code in language with good support for metaprogramming like Ruby you can write some magic code like this one:

"#{params[:type].classify}Calculation".constantize.new.calculate(params)

which in fact can be treated as hidden case statement, but much easier to handle.

Are there any cleaner solutions to such problems which would be more readable? Fortunately, the answer is yes - some frameworks like Ember give possibility to use cool patterns that are not possible in other cases.

Continue reading
40716cc1589577b8eb672d97953c264f

Problems with nil and how to avoid them

Have you recently got an exception saying NoMethodError: undefined method `name' for nil:NilClass? Most likely more than once. And how did you solve it? Maybe you used try and thought the problem is solved... until the same exception happened in a different place! Using methods like try is just treating symptoms, it doesn't even touch the real problem. Maybe the right question would be: why was it nil in the first place? Could it be avoided? Was the possibility of nil a desired behavior? And why at all is nil even a problem? Let's find out and investigate some usecases

Continue reading
32507dc71848e4621d1c714dbf3e3f0c

Working with Perfect Programmers

I've always liked new beginnings, with all the possibilities they bring. And what better way to start fresh with a blog than by writing about one of those first impressions you get when you embark on a new adventure? For me, it was a new job, a new environment, and a completely different approach to work. So, please, fasten your seat-belts and enjoy one of the latest and craziest rides of my life - the introduction to the programming world

Continue reading
11ec30dedeb7889af512461ba7ce6a45

How I work on new features

tl;dr Collect feedback from your customers; always plan what to do next; think about the user interface before you start writing code; discuss with your team your current work often; test what you have done.

Many developers encounter a variety of difficulties when they have to work on new features. From things like: "how exactly should I start?" to more complex issues, for example, in the middle of a development, they notice that everything they have done is wrong and that it is necessary to start over. Therefore, I have decided to share information about my workflow and how I usually get things done.

Continue reading
6b844a73471cf2b060cb54d0b2f16161

Lotus performance tested against Sinatra

Some time ago I heard about Lotus. A fresh Ruby framework for building web applications. It is created from stand-alone parts which are shipped as separated gems. This means that I am able to pick only the essential components for my project. The source code can be found on github.

Continue reading
6b844a73471cf2b060cb54d0b2f16161

The difference between back-references and global variables in Ruby regular expressions

Regular expressions are widely used in the daily work of developers. For example, I can use the gsub method when I want to replace all the vowels in a given string with the underscore symbol:

"here will be dragons".gsub(/([aeiouy])/, "_")
=> "h_r_ w_ll b_ dr_g_ns"

The question is how to wrap each matched vowel with the underscore. The first solution is to use the back-reference in a replacement argument:

Continue reading
11ec30dedeb7889af512461ba7ce6a45

5 functions of the Console object you didn’t know

Not everybody knows that apart from the simplest console.log() used for logging, the Console object has a couple of other equally useful function. I have chosen and described the 5 most interesting but unpopular methods, which can be successfully utilized in everyday work.

Continue reading
11ec30dedeb7889af512461ba7ce6a45

How does our CSS architecture look like after getting rid of Bootstrap

In summer, several well-known companies such as GitHub, CodePen or Buffer have published blog posts about how the CSS architecture is designed in their applications.

Due to the fact that in September we finished transferring Shelly Cloud from Twitter Bootstrap (from version 2.3.2) to the styles developed by us and based on the Inuit framework, I wanted to share the experience that we've gained doing this.

Continue reading
×