Having models in Rails plugins is a bad idea. If you need the model for your plugin - make a generator. Or extend AR::Base with class method that will extend user model to give it desired functionality.
Archive for the 'programming' Category
Updated SWFUpload (2.2.0-beta1) for WordPress 2.6.3
This patch fixes flash uploader for wordpress with installed flash 10.
Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris.
Well, basically that’s all they do.
They have ruby, rubygems and a few gems installed. Also they have a control panel for managing ruby stuff. Have RubyGems manager. But it’s unable to list installed gems, unable to install gems. It’s completely broken. You have to hack a lot in terminal to have an opportunity to install and use other gems.
Next, they have a section for managing rails apps. It can create a new rails app. And… And that’s all. It can not even start that app. It doesn’t generates deploy config. It’s just useless.
BTW, they don’t even think about running mongrels/thins/ebbs/whatever. They are thinking about a single instance on fastcgi.
Next, support. They’re very polite but ignorant. “Is your computer turned on?”. As a solutions they give links to forums where users write “guides” and nothing from site5 itself.
Conclusion: get a slice for same money instead. You’ll be pleased.
BTW, with any VPS you’ll get an opportunity to run not only Rails apps but virtually anything. Like Merb apps.
Kill anybody who’ll write that in spec.
Specification: An explicit set of requirements to be satisfied by a material, product, or service.
I was reading ruby-core mailing list when I stumbled this message about
Improving the metaprogramming facilities of Ruby. It proposes to introduce some changes to Ruby spec regarding instance variables access. The problem is that almost any of proposed changes ends with the silly “the results … are undefined”. Even currently there’s no complete spec for Ruby. The only MRI is a “golden implementation” but still not fully documented and it still has its bugs. Thanks to guys from Ruby-Spec project for their effort on creating complete spec suit to ensure that all alternative implementations are compatible. Anyway, how implementations can be compatible if their behavior is undefined in some cases?
Side note: W3C should also eliminate any undefined behavior for implementations.
Never put application configs in repository. Put there config examples with a explanations in comments instead. That will help users to configure the application better then rewriting teir config on each update.
PS: NDIA - Newer Do It Again
I’ve found a few lines of code that make use of Rails’ method returning. I’ve seen it on the Errtheblog before and thought that it can be useful but someone will misuse it for sure. So here it is.
def feeds_list returning([]) do |feeds| BLOGS.each do |blog| feeds < < feed_url_for(@app_name, blog) end end endWhy do people do such things if there’s Array#collect
def feeds_list BLOGS.collect do |blog| feed_url_for(@app_name, blog) end endI’ve caught myself on coding something for a few days before I even run it first time. But when I do run it the first time it pretty much finished and the only changes I do a simple fixes like typos or minor logic corrections. Maybe some optimizations.
So I’m wandering if other do the same way or if they follow different methodologies in their work like “ship early, release often”.
Забавная диаграммка нашлась в отчете по the Web Design Survey. Она показыват насколько близким к тематике работы было образование респондентов.
А завно то, что чем дальше от темы - тем больше бабала. Вот я и думаю зачем я учусь на программера, работая программером?


Eventune
Firefox
Gentoo
Gnome
Google
Songbird