skwpspace yan pritzker’s home on the web

skwpspace is Yan Pritzker's home on the web

Blog :: Photography :: About Me

TwitterCounter for @skwp

Get the news feed
Get updates by email
Follow me on twitter

hello, i'm yan

This blog is about startups, blogging, Ruby On Rails, virtualization and cloud computing, photography, customer service, marketing, ux and design, git, and lots more.

Top Posts

planypus

I'm the founder of Planypus, the place to share your plans!

cohesiveft

Accessible, manageable, virtualized application stacks ready to download or deploy to the cloud!

flickr

smokingThe old man and the accordionBicycle 6x6Eva 6x6Shaffies 6x6Phone Booth Velvia 6x6WynnStar 6x6

Archives

Contact

Reach me at yan at pritzker.ws

Posts Tagged RubyOnRails

Pretty tree display for all your Rails view partials

If you’re developing an app of significant complexity in Rails, you may start getting lost in a sea of partials. Inspired by an idea by my friend and Planypus developer Alex Antonov, I decided to hack together a little script that does a depth first traversal of all your view files looking for partial calls [...]


Multi column lists using in_groups_of

This code uses the basic technique outlined in this article to split the list up into several lists of a fixed size and then use css to float them into columns.

<% col_size = friends.size/4 %>
<% friends.in_groups_of(col_size) do |group| %>
<div class=‘list‘>
<ul>
<% group.each do |friend| %>
[...]


Dynamically adding instance methods for fun and profit

Here’s an easy way to dynamically add methods to instances of an object for fun and profit. In this case, I had a collection of ‘taggings’ which is a binding between a user and a tag. I wanted to get a count of taggings per tag (so how many users are tagged as a particular [...]


vi mode in rails console

Have you ever been frustrated by the poor command line editing in the rails console?
It turns out you can easily turn on vi mode editing in the irb shell!

$ cat ~/.inputrc
set editing-mode vi

Enjoy!


Rails request log filtering

Just as I was thinking of writing a plugin to filter sensitive data from request logs, I googled and found that the core guys had snuck something into the 1.1.6 release to do just that: read the blog. Sweet!


Encrypted db passwords for Rails with database.yml and erb

Some people are upset that database.yml can expose passwords in plaintext. However, there is a pretty simple way to get encryption into database.yml. Because the database.yml file is actually run through an ERB interpreter by Rails, we can put code into our file:
##### database.yml #####
production:
adapter: oci
username: user
password: <%= PROD_DB_PASSWORD.decrypt(PROD_KEYFILE) [...]


Consuming document literal SOAP webservices with Ruby and ROXML

Ruby support for consuming doclit webservices is still less than stellar. Recently I had the task of integrating a standalone RoR application with a backend Java core login system via webservices. Because of our complex schema, soap4r would not work well for creating the data binding objects. Instead, I discovered a very simple and concise [...]


Rails fragment cache with memcached-client and time-based :expire option

The robot-coop’s memcache-client is the recommended memcache library to use for Rails. However, when I tried to use it with the Rails fragment cache, I found it was simply incompatible. Rails fragment cache wanted read() and write() methods, but the library only provided get() and set(). I took this opportunity to write a very simple [...]


memcached on OSX running fast!

Thanks to Topfunky’s post on memcached, my life has been made much simpler! He’s put together a great little script that downloads memcached and applies the fix that will cause it to run at normal speeds under OS X. I spent about two hours trying to get the sources from darwinports and applying the patch [...]


After →