Code Snippet Sample $ sudo make me a sandwich This is sampleclass Sample def sample "sample" end end class BootstrapLinkRenderer < WillPaginate::ActionView::LinkRenderer def page_number(page) unless page == current_page tag(:li, link(page, page, :rel => rel_value(page))) else tag(:li, link(page, "#"), :class => 'active') end end def link(text, target, attributes = {}) if target.is_a? Fixnum attributes[:rel] = rel_value(target) target = url(target) end attributes[:href] = target tag(:a, text, attributes) end def html_container(html) tag(:div, tag(:ul, html), container_attributes) end def previous_or_next_page(page, text, classname) classname = case classname when 'previous_page' 'prev' when 'next_page' 'next' end if page tag(:li, link(text, page), :class => classname) else tag(:li, link(text, "#"), :class => classname + ' disabled') end end end WillPaginate::ViewHelpers.pagination_options[:renderer] = 'BootstrapLinkRenderer' (server.js) download var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(8124, "127.0.0.1"); console.log('Server running at http://127.0.0.1:8124/'); Awesome code snippet Javascript Array Syntax MDN Documentation var arr1 = new Array(arrayLength); var arr2 = new Array(element0, element1, ..., elementN); Jan 5th, 2013 Comments