Hi, this blog is no longer maintained, my new blog is here

Ruby On Rails and a Conning Israeli entrepreneur

Buzz: rubyonrails.org vs. walla.co.il

Walla.co.il is one of the most visited web sites in Israel, it is some sort of an all-purpose-portal and holds the homepage spot for many people.
I wanted to check how many people are visiting in rubyonrails.org to walla.co.il at compete.com, this is what i got back.

Top 10 Design mistakes on the web

a great article about Do's and Don'ts on web design

How to save money in your startup company


  • Buy Macs, They are a little more expensive, but worth a hell lot of money in productivity terms

  • Buy a second monitor for every programmer, passing through windows (a.k.a: browser to Textmate and back) take a lot of time. worth the money.

  • Buy everyone food, all week long. when people go out to work it takes a lot of "extra" time, by buying them the food, you'll cut off about 20 min. per lunch break.

  • Expensive chairs, crappy desks. most of the programmers i know, appriciate their chair more than their table, their chairs are those big high-backed cousins, while the desk looks like a dump, besides everything you buy should be ergonomically designed

  • Programmers don't need phones, don't buy an expensive phone system, most of the programmers i know talk to each other across the room using Skype :), save the money for an executive phone system, if needed at all.

  • Rent to grow, don't rent offices with no space to grow (expected growth is something you need to calculate prior to renting an office). rent 100% more than what you need.

  • Outsource HR, YOU DON'T WANT THE HEADACHE, assign a professional employee to view the final candidates

  • You don't need an office, you need Google. Don't buy Microsoft office for everyone, buy for 4-5 stations and the rest can use Google Docs of one of those Java based editors (OpenOffice or Neo Office)

  • Use Google Apps, Emails, Documents, Wiki.. why hiring a system programmer for those? or even waste your employees time on building a wiki

  • Key programmers should get a laptop, do i need to expain?

  • Hire devoted programmers, these guys (when payed to the full) will work harder and faster than anyone else in the crazy startup life, compansation via paycheck will be required, but these are valuable employees.

  • Refrigerator, everyone knows that programmers drive on Coffee, Coke and Bamba (in Israel at least, in USA it's Cheetos or something:) ) so i suggest a Coffee machine and a snack drawer in the kitchen, a chocolate bar can do wonders to code.

  • Just finish, allow your employees to work in their own hours, (within reason and except the situation a bunch of programmers is needed to work together) when they are aware that they have a deadline, some people need to sleep until 10:00am, this does not mean they are not right for you

  • Cars, very important, an employee that needs to drive around buses for 2 hours in the morning traffic, is not a happy man

  • Clients don't speak to programmers, they don't speak the same language, use a dedicated person to bridge between the programmers and the clients, or if possible, hire a support personnel

  • Source Control, use Svn, Git or something, just do it...

  • Allow remote connectivity, you can hire people from abroad and still not to micromanage them, think about online collaboration too

  • Task management, use an online application, like basecamp or something, they keep your life easier and cost almost nothing.

  • Open Source, use open source software when possible.

  • (No) power to the people, empower a power saving policy in your startup, turn off screens and hibernate stations on the end of work for starters

  • Big Bad Bandwidth, there is nothing more annoying than slow connections so buy the biggest bandwidth possible, BUT, keep an open eye for Emule connections and such, you don't want it around.


  • that's it for now, thank to all of my programmer friends that helped me composed this one, i'll view the comments and update if necessary

Rails Tip: Annotate models

Ever happened to forget what columns does a Model has?
well, instead of Model.column_names, you can easily install the annotate_models plugin which adds the models schema info as a comment at the top of your model.rb file.

install from

script/plugin install http://repo.pragprog.com/svn/Public/plugins/annotate_models


and from the project root

rake annotate_models

Rails Tip: Render, Better, JS Later

There are certain standards we got used too when creating rails views and layouts, which may cause a problem or some set backs to our applications.
We are all used to coding the JS includes way up in our document, moving the JS to the bottom of the page will render your page a little bit faster, and this is why.

When a browser reads a page, it goes through from the top to the bottom, So when we put the JS include's up, the browser will attempt to download them and hold the dom parsing until it finishes.

Rails Tip: AR eager loading and :select

The AR::Base.find support the options of :include (for adding associations as JOINs in the select) and :select (which pinpoints the columns you wish to select.
For some reason, it is impossible to do them both toghther for example

Article.find(:all, :include => :author, :select => 'authors.name')

This line will raise an exception.
Luckily, there is the select_with_include gem which enables this feature!

first, install the gem

gem install select_with_include

next, require it in your environment configuration file (or in environment.rb)

require 'include_with_select'

Now, you can use the :select option, remembering to use the table name even if a column name is not unique.
There is a single fault back, in case you want to select all the table columns, you need to write them all, one by one. yeah, it sucks.

Restful Web services gem

i recently read at John Nunemaker's blog about a gem he wrote for simplifying the consumption of REST web services.

Read more about the HTTParty Gem

Rails Tip: URLs ending with .html

This is not a must by all means, just for the hack of it.

add to ApplicationController

def default_url_options(options)
{ :format => 'html' }
end


and you don't need any routes.rb changes.

Rails Tip: image_tag, SEO Optimization

when you use rails's image_tag, by default it sets the HTML attributes of alt and title to the filename of the image. so for

image_tag 'dscn0001.jpg'

will produce the following html something like that

<img src="images/dscn0001.jpg" alt="dscn0001" />


the alt attribute for image tag is meant to explain the content of the image in case the actual image was not found, or for non-graphic browsers.

The default value for the alt attribute should not be used, unless the file name does not really supply information about the image. my suggestion is to use the :alt option in the image_tag helper.

important: do not attempt to use the alt for keywords heaping ('elad-rails-blog-ruby.jpg'), this will not help you in your SEO.

Ruby On Bells

This one is great.
some kind of musical instrument that plays random midi tracks according to a ruby script.
here it is:




Ruby on Bells -- RAD Madrona Fork from jd barnhart on Vimeo.

Unveiling the new startup

I am currently up to an exciting new skeem, me and some of my fellow programmers are working for some quiet time on an amazing, innovative music related startup.

What is it about?


Sorry, can't tell ya yet, hold on and don't be so indomite. :)

What am i doing there?


I am 99.5% responsible for the server side (yap, Ruby on Rails!),what seems to be emerging as my finest work. Barak Edry which helped my on Pdfetch.com and worked with me on Creopolis is busy working on the GUI for both the client and the server (yaii, no views for me... i think) and since Ohad Asulin is our Oracle-ninja-C++-shark and therefore too busy to help me on Rails, i was left responsible for the server side. no sweat :)

OK, but you didn't tell us nothing yet


Right, and i am not going to... just wait and see.

When?!


Soon, every on who is playing on ANY kind of instrument, please e-mail me and you'll be notified as sooooooooonn as the public beta goes out.

more on the secret-amazing-startup to come.

Stand Alone ruby on rails application

Ok,
I Don't really know if anyone has ever done this before, but after viewing some unrelated posts regrading ruby and rails, i succeed in creating a stand alone ruby on rails application.
By saying stand alone, i mean you can copy your application to a usb driver, and start your mongrels anywhere you want!.

i wrote some scripts to setup what the application needs prior to loading, and got it running in no time.

i succeeded doing this with rails 1.2.6 so far, but i don't see any reason why i should not do it with 2.0/1.

now my offer goes a little of something like this, if you will come up with an idea how to make me (and you :) ) some money with this new trick, i'll give up 45%.

start thinking :)

Working in the USA

In 3 weeks i am moving to Florida (yeah, i heard everything everyone has to say) and i am currently looking for a job (Rails related of course).

here is my resume, don't be shy...

Ruby on Rails Screen Casts (rated R :) )

I came across during my never-ending quest for Rails and Ruby related websites, in this cute site (re-design, fast) at Ruby Plus.
They composed over 90 (to this day) screen casts about ruby and rails, including some Rails 2.0 roundups, Ruby metaprogramming and so on.

use it, bookmark it, watch it. (and get the feed too :) ).

why i hate Adsense

As it should be clear already, i am the owner of Pdfetch.com. just until the recent facelift, i used Google's Adsense as my ad operator.

and i did an honest mistake.

i copy-pasted a snippet right above the adsense script, which contained the words "click here".

Google didn't like it so much, and sent me an email which says that i violated the usage terms of Adsense by forcing users to click on ads and they will block my site from using Adsense if i will not remove this phrase in 3 days.

WHHHATTT?

lucky me, i saw this message 2 days after my ultimatum was over (they give you 3 days to complay.... mmmm... some counter-terrorist are consulting Google? :) ). anyway by the time i saw this message and begged them to let me remove this error and get back my ads and explaining them what really happaned,
they replied by saying that the will not allow my to use it anymore on Pdfetch.com

real thanks.

that's why i like amazon now :)

Rails and Oracle, new blog

Hi all,
I am happy to announce that Oracle On Rails, the too-much-anticipated blog from Ohad Asulin about working with Oracle and Rails, Ohad is one of my colleagues and is an excellent Oracle-Ninja, i strongly advice going up on this one (and generally move to Oracle for large scale applications),
you might really like to hear what this guy has to say.

Working with Rails mixup

Uhhh, what can i say..... i am stupid.


i tried to access my account at workingwithrails.com and i forgot my password.
PAUSE
Now i will explain what happend as simple as possible (for you all to laugh at me real good).

Smart:
"oh goodddie, a reset password page!".
very very VERY stupid:
"mmm, i need to fill in the email i registered with, oh it's .. good, it sent me the new details"
after 5 seconds when i realized that i can't read messages from that box.
"oh men!!!!!"

Short and less annoying version for what i did:
Gone to the reset password, reseted password and sent the new details to an email account that i don't own anymore and belongs actually to one of my ex-employers.


damn,
hope to get my account back with the help of WWR support.
and i don't even remember why i wanted to login in the first place :)


PDFetch facelift!!!!

Pdfetch.com was just facelifted al little bit, i was really unhappy for some reason from the previous design, so i did about a 2-hour-fest to do it in another way.

i switched my ad system from Adsense to the Amazon affiliate system, i think it will be more rewarding.




Finally Decided: JQuery, not Prototype

JQuery (for those of you just landed from Mars) is an unobtrusive javascript framework. read more at the JQuery home page.
jQuery supports Behavior driven development and is based on traversing HTML documents by CSS Selectors.
vs.
Prototype,
Prototype is also JavaScript library for Class driven development which makes life easier working with JavaScript. Prototype library has a good support in Ruby on Rails via helper functions and is basically well embedded in.

i decided to try to match both of these libraries (and dojo for the matter of fact, but the project was halted), and here are my conclusions.


  • BDD


    JQuery is very similar to CSS by assigning the HTML element behaviour out-side the HTML, so it is generally more adequate for MVC.
    for ex:

    $(element).click(function() {
    alert("warning");
    });

    simple.

  • Chaining
    Chining methods is as simple as ruby. period

  • CSS Selectors

    Since JQuery is based upon CSS, you can access any element by it's CSS path, and avoid these annoying pesky ID's you have to put using Prototype.


for some more comparisons, visit the Ajaxian article

Finally:
Jquery and prototype are both great. For me, i prefer JQuery since it's approach appeals to me more than Prototype's, Although prototype is kinda Rubish and has inbound support from Rails, JQuery is still cleaner to me.
Did someone said JQuery to Rails integration?

Ruby On Rails Developer Salary in the US


the graph is right here


Data Provided by of simplyhired.com, a search engine for jobs.

As i can see, $86,000 per year, that makes it about $7,100 USD a month, which is just a little more than what a super-rails ninja can get here in Israel, probably more for a short period projects.

how come?

web 2.0 validator

this one is good :)

this site redicoulesly rates your site as a web2.0, the check-list veries from "Denies Rocky V?" to "has favicon?".

Rails.il... Finally!

I ran across the newly and very anticipated rubyonrails.org.il.

This is a great idea that i tried to pull back at Creopolis, but sadly half way there i was no longer an employee there (too bad :) ).
anyway, the guys apperantly responsible for this unexpected yet enjoyed surprise are QCM
way to go guys, looking forward to help.



Use Facets

i am ashamed, i just recently noticed some of my associates are using a gem called "facets".

i was amazed to see how helpful this gem is! the 'facets' gem added a whole bunch of core extensions to the ruby core.
i strongly advice the use of facets.

i woun't fill you up with details, just point out to the links below:


more to come soon!.




Run RUBY!!! RUNNN!

According to a Nimble Method post, ruby is slow (i don't really agree on the other hand) cause' of a garbage collector bugs.

Some Patches are suggested in the post, if you want them... they are here to get.



Apache X-SendFile in Rails

" There's this slick HTTP header called "X-Sendfile" that Apache and Lighttpd support. It was made to address this kind of problem (isn't that convenient?). Now, when you send an HTTP response, all you have to do is tack on an X-Sendfile header with the path of the file you need to send—don't worry about actually reading the file or sending any of those bytes yourself. The web server will load the file you specified and send it downstream."


nothing to add, read more on John Guenin Post

p.s
Benchmrk'd to 400% faster for one of my apps. great job



Ruby Coding Convetions

When working in a team, you must be able to understand and to complete/continue other people code, although rails itself is very easy to understand, some of us need some further instructions :).


get them here




RandExp Gem

the RandExp is an extraordinary gem.
using this gem you are able to generate a value corresponding to a Regexp statement.
read more in the documentation.


The Web Ask eizesus.com

Subscribe

    follow me on Twitter

    Twiters Around

    About Me

    My photo
    I am a web developer for more than 9 years, managed, cried, coded, designed and made money in this industry. now trying to do it again.

    Labels