“I don’t have time to contribute to open source”. But who does? We’re too busy shipping products and open source is so daunting and time consuming. Sure tools and technologies are our livelihood, but there’s just so much there. Even if you’ve got the time - where do you start?
What if giving…
Found this post regarding Law of Demeter (LoD) after using Rails Best Practice to evaluate a Rails app I’m working on.
The post is very Rails oriented.
Note to self, LoD is not an end itself.
It’s important to understand that the Law of Demeter is a heuristic, not an end in and of itself. It is not a law in the sense that you “must” write your code in a certain way. Rather, it is a law in the sense that it has been consistently observed that if code complies with the Law of Demeter, it almost certainly has a number of the qualities—encapsulation, loose coupling, etc.—desirable in an OO system.
This looks cool, will check it out for a project soon. It powers http://cibox.org/ and it’s in Ruby.
require ‘e’
class App < E
map ‘/’def index
# …
endend
App.run
From Android to iPhone, users everywhere have made it abundantly clear that mobile apps are the future, and when it comes to mobile nothing beats a native experience. Native apps mean we need API’s, and API’s need Authentication. That’s why I’m happy to introduce the solution to your mobile Rails…
Ruby’s Symbols Explained
Explain is a gem which can explain your Ruby code in natural language as shown below which works only with Rubinius.
The github page is at https://github.com/txus/explain.
Check the example below;
class Person
def walk(distance)
@distance += distance
@hunger += 2
end
end
Run explain on the code above
$ explain person.rb
Let’s describe the general attributes and behavior of any Person.
A Person can **walk**, given a specific distance. This is described as follows: its distance will be its distance plus what we previously defined as `distance`. Finally we return its hunger will be its hunger plus the number 2..
Need this for a project of mine. This seems handy if you’re planning to use cloudinary to build a photo storage web application or something.
Way back in mid-2007, when Rails 1.2 was the new hotness and GitHub was still a year away from crawling out of the primordial internet soup, prolific open source contributor Dr Nic wrote an article titled “8 steps for fixing other people’s code”. It offers excellent general advice, but the…