Convert colorspace of images attached with Paperclip

has_attached_file(
  :avatar,
  :styles => { :large => "300x300", :small => "100x100" },
  :convert_options => { all => "-colorspace RGB" }
)

Parse XML or HTML with Nokogiri

To parse XML-documents, I recommend the gem nokogiri.

A few hints:

  • xml = Nokogiri::XML("<list><item>foo</item><item>bar</item></list>") parses an xml string. You can also call Nokogiri::HTML to be more liberal about accepting invalid XML.
  • xml / 'list item' returns all matching nodes; list item is used like a CSS selector
  • xml / './/list/item' also returns all matching nodes, but .//list/item is now an XPath selector
    • XPath seems to be triggered by a leading ....

Basic styles for flash notifications

.notice,
.error,
.information,
.warning {
    font-weight: bold;
}

.notice {
    color: #11bb00;
}

.error {
    color: #F53A31;
}

.information {
    color: #557;
}

.warning {
    color: #d07d2d;
}

Typical .gitignore

log/*
tmp/*
storage/*
db/*.sqlite3
db/schema.rb
db/structure.sql
public/system
.project
.idea/
public/javascripts/all*
public/stylesheets/all*
public/stylesheets/*.css
config/database.yml
*~
*#*
.#*
.DS_Store
webrat-*.html
capybara-*.html
rerun.txt
coverage.data
coverage/*
dump_for_download.dump
.~lock.*
.*.swp
C:\\nppdf32Log\\debuglog.txt

Nicole Sullivan: "Design Fast Websites" on Yahoo! Video

Web performance expert Nicole Sullivan discusses a set of best practices in the creation of supremely fast, visually impactful web sites.

mezzoblue § Sprite Optimization

Maybe I haven’t been paying close enough attention, but over the past few years an interesting variation of CSS Sprites has been getting a lot of play on large web sites that serve millions of users.

SASS: The Better, More Powerful CSS - Intridea Design Blog

I am a huge fan of SASS (Syntactically Awesome Stylesheets) for styling Rails applications. I have been using it on all of my projects for quite a while now and have developed some great techniques that make it much easier to organize, write, and read stylesheets in an application

JSMIN, The JavaScript Minifier

JSMin is a filter which removes comments and unnecessary whitespace from JavaScript files. It typically reduces filesize by half, resulting in faster downloads. It also encourages a more expressive programming style because it eliminates the download cost of clean, literate self-documentation.

Index of /projects/sleight

PNG transparency for IE 6.

Module: Sass

Sass is a meta-language on top of CSS that‘s used to describe the style of a document cleanly and structurally, with more power than flat CSS allows. Sass both provides a simpler, more elegant syntax for CSS and implements various features that are useful for creating manageable stylesheets.

Sickill.net - Colorizing console output with Rainbow ruby gem

If you’re working on some cool ruby console-based application or just want to add a little style to your script here is a nice gem for you. It’s called Rainbow and it extends ruby String class adding methods to wrap the string with ANSI escape codes.

Cross-Domain Data with Rack and Rails | Union Station

Asynchronous JavaScript and CSS, also known as CSSHttpRequest, is a method of URI-encoding data in 2KB chunks split over several CSS rules with a modified data URI scheme. Because CSS is not subject to the same-origin policy, no service proxy is required.

SlickMap CSS — A Visual Sitemapping Tool for Web Developers

SlickMap CSS is a simple stylesheet for displaying finished sitemaps directly from HTML unordered list navigation.

iui - Google Code

iUI is a framework consisting of a JavaScript library, CSS, and images for developing iPhone webapps.

Scrippets

With Scrippets, you can add boxes of nicely-formatted script to your blog. It even works in comments.

Go Ahead: Next Generation Java Programming Style | Code Monkeyism

Even if you’ve trapped, you can change your programming style and reap some of the benefits of those new languages. In the last 15 years Java programming style has changed significantly.

aanand's deadweight at master - GitHub

Deadweight is RCov for CSS, kind of. Given a set of stylesheets and a set of URLs, it determines which selectors are actually used and reports which can be "safely" deleted.