Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts

Wednesday, August 19, 2009

@_why the long face

Today an event most strange occured on the net. A true inspiration and genius simply vanished. Why the lucky stiff, a querky, prolific coder and guru has been throughly deleted from the net. All his sites and projects are now only available through mirrors.

No reason and no farewell, just gone. There is talk that someone disclosed his identity against his will. If that Is the case then that person is responsible for the loss we all feel. They should be shunned, possibly injured.

Out of the seathing mass of mediocraty that is humanity there are so few who make a difference. Why was one of the rare people who worked to improve the world in which they opperate, and did so largely selflessly.

It is a great saddness to loose him.


Monday, July 20, 2009

#{rails}

Well Strike me down and call me a noob
in a haml file:
:javascript
$(function(){$("#div_id_#{my_rails_object.id}").somefunc()});

Wow, the above works!

Sunday, June 28, 2009

Ticket Manager

Just made a little rails ticket manager which is now hosted at heroku.com.
Gonna keep the heroku given name of blooming-rain-76 for now.

You can sign up, create a project, create tickets for projects, create comments for tickets, set ticket priority and status. can also request to join another users project but user stuff is not all there yet.

Tuesday, April 7, 2009

Rails and Dates

Stick this in environment.rb after the initialize block and have dates in the format you want.

ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default => '%d/%m/%Y')

Model.date.to_s will use the default in the DATE_FORMATS hash if present.

ruby makes you smile

def self.randy n
(1 + (rand * n-1).round)
end

Thing.create!(:bob => randy(730).days.ago.to_date)

I know its nothing that complex, but it just highlights how friendly Ruby is.

Monday, March 30, 2009

ruby is so cool

result = things.select do |thing|
//some code
end if some_criteria