18 April 2014

The Ruby Reflector

Topic

David Bock

  Source Favicon
By David Bock of On the Path almost 2 years ago.
Email

Just over 5 years ago we started CodeSherpas with a vision - the nature of software development is changing, and we wanted to be on the forefront of that change. Our jobs are many and varied - sometimes training and mentoring, sometimes augmenting existing staff, sometimes the project is ours and ours alone. Sometimes we work at home, sometimes on client-site. We bring the deep experience we have developed to bear on our client's projects, and have a strong reputation doing so.

blog.codesherpas.com Read
  Source Favicon
By David Bock of On the Path almost 2 years ago.
Email

"Its never any one feature that causes problems; it is the interaction of otherwise reasonable-seeming features."

In a recent conversation with a number of NFJS speakers , David Sletten (via his brother Brian) brought up a tricky Java puzzler - a piece of code that is seemingly simple, but doesn't do quite what you'd expect. Consider: Arrays.asList(new Integer[] {1, 2, 3}).size(); Arrays.asList(1, 2, 3).size(); Arrays.asList(new int[] {1, 2, 3}).size();

blog.codesherpas.com Read
  Source Favicon
By Gregg Pollack of Riding Rails - home almost 4 years ago.
Email

…you're logging model/table changes on a per user basis. There are many hacks to accomplish this, but David Bock has a gem called SentientUser which does this a little cleaner.

Once your websites goes big and you start to worry about malicious user attacks, you may want to take a look at Arto Bendiken and Brendon Murphy's Rack::Throttle Middleware . Throttle does just want you think it does, allowing you to limit the number of requests a user can ping your …

weblog.rubyonrails.org Read
  Source Favicon
By David Bock of On the Path 2 years ago.
Email

I'm doing a lot of work lately using ActiveResource. I wanted to get 'down to the wire' and see the traffic flowing over http... so a quick google search, and I found an entry I had written in 2008. I love it when that happens! So I'm reblogging it with a slight change to make it work in Ruby 1.9.

If you're using rails, create an initializer name active_resource_spy.rb and drop in this content:

class ActiveResource::Connection

# Creates new Net:: HTTP instance for communication with

blog.codesherpas.com Read
  Source Favicon
By David Bock of On the Path almost 3 years ago.
Email

I have been a customer of Tivo for a long time; I first saw one at a friend's house in the fall of 1999, and bought one for myself that Christmas. Over the years I have owned somewhere around 6 tivos... Upgrading when the series2, series3, and most recently the Tivo Premiere came out.

Of course at its heart, the Tivo is a computer with a hard drive, and in the past 12 years I've had a few technical issues. This story starts last month when my Tivo Premiere died a horrible …

blog.codesherpas.com Read
  Source Favicon
By David Bock of On the Path almost 3 years ago.
Email

This is a small complaint about Rails 3.1, but its one I'm surprised I'm able to make at all.

If you have been following the evolution of Rails, you know that years ago the framework adopted REST as one of its core principals (well, restful concepts - I'll leave it up to others to debate/defend the true purity of the implementation). One of the core ideas behind REST is the idea that a url represents a unique resource, and that the mimetype/filename extension is used to …

blog.codesherpas.com Read
  Source Favicon
By David Bock of On the Path almost 3 years ago.
Email

I was just doing some routine maintenance on our servers when I had to use some command-line judo so solve a small issue and thought I'd share it. Not for the particular solution, but for the path of thought that led to the solution; that is, demonstrating the power of the unix/linux command shell.

On a server running CentOS 5.6 (a linux distribution), I ran the command to perform routine maintenance and got an error upgrading a package named "shadow-utils-4.0.17-18.el5_6.1.x86_64". …

blog.codesherpas.com Read
  Source Favicon
By David Bock of On the Path 3 years ago.
Email

Dear Restaurant owner,

I want to eat at your restaurant, but I need to find you first. You need a website. And not just any website. It has to work on a mobile device. If not, you might as well not exist anymore.

In the past few months, I have been out with my friends several times, spontaneously decided to get a lunch, dinner, etc. and had a bad experience with a restaurant's website.

Today's typical dining experience starts with a bit of research on a phone, looking for a …

blog.codesherpas.com Read
  Source Favicon
By David Bock of On the Path 3 years ago.
Email

Fullcalendar is an impressive calendar widget for JQuery, showing you events on a month, week, or day view, and letting you drag them around to reschedule them.

It needed a good sample app showing how to use it in Rails 3, so I wrote one .

Rails3_fullcalendar is a rails application that tries to live up to the rails3 notion of restful ideals. It does this thanks to the power of Adam Lassek's jquery.rest plugin , which handles all of the wrapping …

blog.codesherpas.com Read
  Source Favicon
By David Bock of On the Path 3 years ago.
Email

Last night we performed some upgrades and restarted a server with nearly a year of uptime. This morning I was checking on the status of the server, and saw this graph. It is a beautiful example of the kinds of things you can see with Munin.

You are looking at a graph from munin , showing the usage of memcache of a large Ruby on Rails application.

After the server restarted, the cache was empty. As the server traffic picked up this morning, more and more database …

blog.codesherpas.com Read