...you can force absolute URLs throughout a response. Now you want to modify URLs similarly, but only in parts of a view (or controller) logic. Here is how.

...has only been tested on a Rails 2 application. It should work similarly for Rails 3. Put this into your ApplicationController: def rewrite_options(*args) options = super options.merge!(:only_path...

Active Record's select method allows you to make use of the power of MySQL select statements. On the one hand it allows you to select specific fields. Post.select("content...

...results in the following query: "SELECT content FROM `posts`" This means that your models will be initialized with only the content attribute and you will not be able to access...

makandra dev

With Rspec you can mock objects or functions, for example like this: expect(my_object).to receive(:my_function).and...

Unfortunately, Capybara does not offer a switch to disable cookies in your test browser. However, you can work around that by using a tiny Rack middleware -- it works for both...

...Selenium and non-Selenium tests. Wouldn't it be nice to say something like this? Given cookies are disabled When I try to sign in Then I should see "Can...

...UI's date picker and date time picker doesn't work on touch interfaces. Solution 1: Use Mobiscroll Another way is to detect touch devices and for those devices use...

...the Date and DateTime picker from Mobiscroll instead: if (isTouchDevice()) { $('.date_picker').scroller(); } else { $('.date_picker').datepicker(); } Mobiscroll uses a spinning wheel UI for picking dates and times, as known...

Since we are using LoDash instead of UnderscoreJS in recent/current projects, you should keep in mind that their syntax is a bit different. UnderscoreJS In UnderscoreJS, methods always return a...

...x).uniq() // => [1, 2] If you want to chain multiple calls, you need to start off with a _.chain, and call value() to terminate the chain. _.chain(x).uniq().map...

Here is a symbol of an eight note: ♪ Its two-byte hex representation is 0x266A. This card describes how to create a string with this symbol in various languages.

Since our tool chain (editors, languages, databases, browsers) is UTF-8 aware (or at least doesn't mangle bytes), you can usually get away with just pasting the symbol...

After updating Rubygems you see a wall of deprecation warnings like this: NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after...

...Gem::SourceIndex#add_spec called from /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:197. NOTE: Gem::SourceIndex#add_specs is deprecated with no replacement. It will be removed on or after 2011-11-01. Gem::SourceIndex...

makandra dev
vectormagic.com

Automatically convert bitmap images like JPEGs, GIFs and PNGs to the crisp, clean, scalable vector art of EPS, SVG, and PDF with the world's best auto-tracing software.

makandra dev
zeldman.com

...of things, and grownup professionals plan for it, just as they plan for budget shortfalls and extra rounds of revision...

makandra dev
github.com

...work cross-domain by tunneling all communications through an IFRAME on your page. Note sure if it's a wise idea, but it's a thing now...

makandra dev
github.com

jQuery plugin to fire events when user's cursor aims at particular dropdown menu items. For making responsive mega dropdowns...

developer.mozilla.org

...let you move back and forth through the user's history, as well as -- starting with HTML5 -- manipulate the contents of the history stack...

intridea.com

This article shows how to create a Sass mixin for a colored button. The button's foreground color is dynamically chosen between either black or white, depending on the given...

...background color. It's a nice intro into @if and @else conditionals in Sass...

github.com

...helpers for poking around at your Capybara driven browser's cookies in integration tests. Supports Capybara's bundled drivers (rack-test, Selenium Webdriver), and adapters for other drivers may be...

makandra dev
addyosmani.github.com

Twitter's Bootstrap CSS blueprint as a jQuery UI theme. Even if you don't want to use Bootstrap as...

blog.peepcode.com

...at least four times2, including a recent rewrite for the upcoming Rails 3. The syntax is now more concise. But never mind making it shorter! It’s time for a...

theexciter.com

...when there’s a gem update I know that it has actually been tested somewhat and it’s not just whatever random point HEAD happens to be at, at that...

m.onkey.org

decided to go fixtureless with Shoulda + Factory Girl. All good, except one problem. Slow as fuck tests. So here’s fast_context as a solution for it. fast_context compiles...

...all the ‘should’s within a context into a single test...

css-tricks.com

...the ‘border’ of any block level element gets factored into it’s final box size for layout. That means that if you add a border on a hover to an...

...element that didn’t already have a border of that exact size, you will cause a layout shift...

makandra dev
documentcloud.github.com

...a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built...

makandra dev
staringispolite.com

...time programming languages understood what the kids are typing these days. So let's start with a baby step in that direction: Like, Python...

daringfireball.net

...Apple does not want is for some other company to establish a de facto standard software platform on top of Cocoa Touch. Not Adobe’s Flash. Not .NET (through MonoTouch...

javascriptweblog.wordpress.com

Inspired by a snippet of code in Oliver Steele’s legendary Functional library, here’s a lightweight tool to help keep track of JavaScript invocations. It works in Chrome, Safari...