The Insufficiency of Good Design by Sarah Mei

As a developer you should have come to a point where you think about quality of the code you write. You must have wondered what good code actually is and how good design can be achieved. This talk by ‘Sarah Mei’ clarifies the idea of Good code and also provides guideline of how it can be achieved. Good code isn’t written always by everyone. Hence, we need to keep these points in the back of our head which are noted below.
Continue reading

Custom fonts with Wicked PDF on Rails

Well! We all have had a hard time getting through the custom fonts in our website or web-application. It has been easier with the @font-face implementation through CSS though this requires different formats of file integrated through it.

This implementation was OK until our client wanted to have the custom font implemented in the PDF generated by wicked_pdf in our Rails Application. This was not working right as intended, PDF using the default font rather than the custom font specified. And yes, we couldn’t even inspect element to diagnose the problem as could be done in webpage.

Continue reading

Is class required while experimenting Ruby codes in file?

Dear Rubyists,

There I was trying to guide a very good friend of mine, Sajin Shakya who was keen to learn a programming language, Ruby On Rails. I suggested him not to jump onto Rails and dig deep into Ruby first. Hence, as he had learnt C programming earlier, I told him to practice developing similar algorithms he’d previously learnt in his academics through Ruby.

So, he created a method which would calculate the factorial of given number as follows:

Continue reading

Validation on create with Ripple (Riak On Rails)

Previously I mentioned how to achieve Uniqueness Validation With Ripple.

Similarly, Ripple doesn’t provide direct method for adding validation only on create while trying to implement Riak On Rails using Ripple as modeling layer. This is very much necessary for the validation of properties such as password which are to be checked only while being created. Below is the code sample I developed for validation on create manually.
Continue reading