Intridea at RailsConf Europe and Lone Star Ruby

Posted by on August 31st, 2008.

Intridea will be speaking at two Ruby/Rails conferences this week. If you're attending either conference, make sure you come by and say hi!

RailsConf Europe

RailsConf Europe 2008 Pradeep Elankumaran and Michael Bleigh will be presenting their RailsConf Europe tutorial: The Renegade's Guide to Hacking Rails Internals, on September 2nd.

This far-reaching tutorial will give Intermediate and Advanced Rails developers a crash course in hacking and extending Rails internals. The topics covered will include: Ruby Meta-programming Techniques; Rails Abstractions, Idioms & Mixins; Rails Structure & Initialization; A Tour of the Rails Class Loader; Plugin Locators and Loaders; Codebase Modularization using Rails Plugins; Extending ActionView Form Builders; Site-wide Settings; and much more…

Michael Bleigh and Chris Selmer will be presenting a RailsConf Europe talk: Hacking the Mid-End: Unobtrusive Scripting and Advanced UI Techniques in Rails, on September 3rd. Here's the talk overview:

As web application development advances beyond the static page, a whole new field of development is emerging. In the Javascript behavior layer and markup abstracting helpers lie the ’Mid-End’: advanced user interface problems that don’t fit traditional ‘back-end’ and ‘front-end’ models. Explore this new field with case studies and real code such as usage of Lowpro Javascript behaviors to keep the behavior separate from the markup. Learn how to give back-end developers the tools to create simple, repeatable, quality markup through block-accepting helpers. Discuss the methods that allow for rapid development of complex interactions in new and exciting ways and see real examples. Finally, look into the future of the Mid-End and what lies ahead for user interface development.


The Lone Star Ruby Conference

Adam Bair, Pradeep Elankumaran, and Chris Selmer will be leading a training on the first day of the LSRC. The training is titled: Rails Refactoring: Triage, Prevention, and Performance. And the overview:

Maybe you inherited a mess of a Rails project – or perhaps your own codebase is poorly-tested, not very DRY, or just generally confusing. Worse yet, maybe your Rails site has slowed down to a crawl or even stopped working entirely. Whatever the reason, it’s time to consider refactoring these rough spots and boosting your site’s performance.

In the first half of the day we’ll go through real-life examples of (shameful) code we’ve written and refactored, give tips on how and when to start, and show you how to avoid the need for a future refactor. In the second half, we’ll introduce common Rails performance pitfalls, how to diagnose them, and how to solve them. We’ll also talk about other ways to speed up your app.
Share:

Comment on this post (0 comments)


Colorist: Color Manipulation For WebHeads

While writing color customization code for a recent project, I once again ran into the fact that the existing color gems for Ruby seem to be built for vastly different purposes. To that end, I decided to write a new library for dead-simple manipulation of colors with an emphasis on ease-of-use and being useful for web developers.

Installation

gem install colorist

The Basics

To instantiate a color in Colorist, you use a number of methods:

require 'colorist'
include Colorist

red = Color.new(0xff0000)
red = 0xff0000.to_color
red = "red".to_color
red = "#f00".to_color
red = Color.from_rgb(255,0,0)

Note: I include Colorist in these examples, but there’s no reason you can’t leave it namespaced i.e. Colorist::Color instead.

The idea is to give maximum flexibility without making it complicated. Once you’ve instantiated a color, you can figure out a few tidbits about it and perform some basic operations:

red.brightness # => 0.299
red.r # => 255
red.invert # => #<Color #00ffff>
red.text_color # => #<Color #ffffff>
red.to_s # => "#ff0000" 
red.to_s(:rgb) # => "1.000, 0.000, 0.000"

Operations

The real value of Colorist comes in comparison and addition. You can use normal operators with the colors to add them together, subtract them, and compare them based on brightness. You can also do this with the string or numeric representations of colors:

red = 0xff0000.to_color
green = 0x00ff00.to_color
yellow = red + green
yellow = "red".to_color + "green" 
yellow.to_s # => "#ffff00" 
red - 0.2 # => #<Color #cc0000>

Comparisons work off of the brightness of a given color. You can also calculate the contrast between two colors using the W3C’s formula:

red = "red".to_color
red > "black".to_color # => true
red > "white".to_color # => false
red.contrast_with("green".to_color) # => 0.500653594771242

Get Coloring!

That’s most of the basic functionality, for all of the details you can view the RDoc on RubyForge. The source is available on GitHub and there is a Lighthouse project for any bugs or feature requests. Enjoy!

Share:

Comment on this post (5 comments)