Wednesday, June 4, 2008

Netbeans Keyboard Shortcut - My Cheatsheet

To Be Continued...

Full screen: Alt+Shift+Enter

Search:

Navigation:
Go To Declaration: Ctrl+B
Go To Line: Ctrl+G
Go to File: Alt+Shift+O
Toggle between open docs: Ctrl+Tab
Next word match:Ctrl+K/Ctrl+Shift+K

Rails:
Ctrl+Shift+A: Navigate to view/controller

Some links:
NetBeans IDE 6.0 Keyboard Shortcuts Specification
10 Handy Editor Shortcuts in NetBeans IDE 6.0
Another One

Sunday, June 1, 2008

Web Trends for 2008


Web Technology Trends for 2008 and Beyond, May 2008 Update


From: ricmac, 3 days ago





An overview of emerging web technology trends, as covered on top tech blog ReadWriteWeb; such as Websites becoming web services, Semantic Apps, Open Data, Mobile Web, Recommendation Engines. This presentation was given by ReadWriteWeb Founder and Editor Richard MacManus at XMediaLab, Wellington, May 2008.


SlideShare Link


Thursday, May 29, 2008

Disable rails session for robot (search engine crawler)

class ApplicationController < ActionController::Base
session :off, :if => lambda {|req| req.user_agent = ~/(Google|Slurp)/i}
# Google for Google and Slurp for Yahoo!.
# Explore your log for more robots

* Cited from The Rails Way

Rails RJS examples and official doc

With rjs, you can call the ajax helper without specifying the html elements. Moreover, you can do whatever you want after the action(update several divs, etc.).

render :update do |page|
page.replace_html 'div1', "HAHA"
page.replace_html 'div2', :partial => 'person', :object => @person

OR, you can create a rjs template:show.js.rjs, and put the rjs code there.

In the controller, you'll then have:
def show
...
#no render at all
end

Rails will pick the right template automatically.

Official rjs docs

Handy behavior driven Rails Ajax helpers

Periodically_call_remote:

periodically_call_remote(:url => 'update', :frequency => '20', :update => 'news_block')

observe_field:
<%= observe_field :suggest, :url => { :action => :find_suggestion },
:frequency => 0.25,
:update => :suggest,
:with => 'q'
%>

Rails named route

map.purchase 'products/:id/purchase', controller => 'catalog'

can be invoked with purchase_url(:id => 1)

Rails 2.0 Root Route

The proper way of setting root route in Rails 2.0

map.root : controller => "homepage"