Archive for the ‘Programming’ Category

Quick Tip: Rails Named Bind Variables

Sometimes, Rails queries can get long and complicated. Using named bind variables is an easy way to give some context to the query and, when you need to supply the same value to multiple query conditions, can shorten the query parameters.

Read the rest of this entry »

Quick Tip: Cucumber Works-in-Progress

Cucumber has a relatively new feature that allows you to tag individual scenarios as “should pass” versus “work-in-progress”. Rake tasks are provided that run the two groups of tagged scenarios separately.

Read the rest of this entry »

Quick Tip: Rails Singularization of -ess

The Ruby on Rails built-in inflections don’t handle singularizing words like “business” or “address” correctly. Here’s a quick way to make sure it’s handled in your Rails project.

Read the rest of this entry »

Fixing Multipart Uploads in Rack for Ruby 1.9

Describes a fatal error in Rack v1.0.0 that may need to be patched until a new version is released. If you’re seeing a “invalid byte sequence in US-ASCII” error, then read on!

Read the rest of this entry »

Using Named Scopes in a Rails Plugin

I encountered a problem after extracting some common functionality into a Rails plugin that contained two named scopes. It was not returning the correct results and it took me a while to figure it out. With the help of Chris Chandler we determined the cause and a solution so that the named scopes work correctly from within a Rails plugin.

Read the rest of this entry »

Quick Tip: Override Rails Generated URLs

I explore a quick and simple way to change the default URLs generated for a Ruby on Rails resource. With this tip, there’s no need to modify the usage of URL helpers or anything else in your code. After making the change URLs for that resource will be generated as you’ve specified them.

Read the rest of this entry »

Enable Secure Admin for Wordpress

Do you access your Wordpress installation from untrusted locations like coffee shops? If so, you may be sending your password in the clear and any malicious individual can see it!

This post describes the steps I took to secure the Wordpress administration area for Millarian. It will lead you step-by-step through creating a self-signed certificate, modifying Nginx and modifying Wordpress to enable this functionality, all with supporting documentation.

Read the rest of this entry »

Igniting Phoenix Developers

Developer Ignite Phoenix is an event hosted by Intel following the same format as O’Reilly’s Ignite events. Each speaker has 5 minutes to talk about the contents of their 20 slides. What’s different about this event? It’s all about the technology, baby!

Come see my partner at Flatterline, Chris Chandler, speak about cryptography.

Read the rest of this entry »

Monitoring Thin using God, with Google Apps Notifications

We’ve been using God to monitor our Thin processes on Freebootr and set it up to notify us through our Google Apps account. Thought our God config file might be useful to anyone trying to use God with Thin and Google Apps.
Thin configuration

# == God config file
# http://god.rubyforge.org/
# Authors: Gump and michael@glauche.de
#
# Config file for [...]

Read the rest of this entry »

Installing aspell and raspell for Ultrasphinx

We’ve been playing around with the Sphinx full-text search engine and Ultrasphinx, the Ruby on Rails configurator and client to the Sphinx full text search engine. Sadly, it was giving us a warning about spell checking:
ultrasphinx: spelling support not available (raspell configuration raised “uninitialized constant Ultrasphinx::Spell::Aspell”)
This is pretty easy to get rid of, though. You [...]

Read the rest of this entry »