Subscribe: Robby on Rails
http://www.robbyonrails.com/xml/rss/feed.xml
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
argon  code  github  google analytics  google  hosting  planet argon  planet  rails hosting  rails  ruby rails  ruby  time  zsh 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Robby on Rails

Robby on Rails



thoughts.sort_by{|t| t[:topic]}.collect



 



8 things I look for in a Ruby on Rails app

Thu, 06 Jul 2017 12:59:00 -0500

As a consultant, I’ve looked over a shitload (how many? probably ~150-200) over the last 12 1/2 years in the Ruby on Rails community. I haven’t worked on most of them, but I do get invited to look over, review, audit, and provide feedback on a lot of those.

Over on the Planet Argon blog I’ve shared my quick hit list of a few initial things that I look for when looking over an existing code base.

Read Ruby on Rails Code Audits: 8 Steps to Review Your App




Lessons in Open Source

Mon, 27 Jun 2016 12:04:00 -0500

A few months ago, I wrote an article on Medium about my experience of starting Oh My Zsh. Thought I’d share it for the few lingering readers over here, too.

d’Oh My Zsh: How I unexpectedly built a monster of an open source project




PostgreSQL is the preferred database of Ruby on Rails developers

Fri, 03 Jun 2016 02:08:00 -0500

The 2016 Rails Hosting community survey results are in. One of the numbers that I’m tickled with joy about? 84% of Rails developers said they’d prefer to use PostgreSQL.

We won!

Check out all the survey results at http://rails-hosting.com/




2016 Rails hosting survey is open

Tue, 12 Apr 2016 12:50:22 -0500

If you’ve not taken the 2016 Rails hosting survey, please do so at http://rails-hosting.com/




Tom on Automatic Differentiation

Thu, 11 Feb 2016 13:19:00 -0600

Tom Stuart posted up an excellent article on Automatic Differentiation in Ruby with links to his talk slides and video.




Action Cable demo by DHH in Rails 5

Sun, 20 Dec 2015 11:08:00 -0600

David was kind enough to put together a demonstration of how to take advantage of Action Cable in Rails 5.

width="560" height="315" src="https://www.youtube.com/embed/n0WUjGkDFS0" frameborder="0" allowfullscreen>

In the video he puts together a small chat application.




Ezra Zygmuntowicz -- Farewell, Friend.

Mon, 01 Dec 2014 11:53:00 -0600

Yesterday, I found out that Ezra Zygmuntowicz had passed away.

Ezra and I first met in the #Caboose family. The first time we got to spend time together, in person, was at RailsConf 2006.

(image)

(photo credit: Jarkko Laine)

A few weeks later, he emailed me to ask about getting a job here at Planet Argon. We couldn’t afford him so he continued to pursue other paths… and a month later was helping found EngineYard.

(…one of those things that I still find myself asking, “what if we could have?”)

Back when Planet Argon had a hosting department, Ezra and I collaborated on various deployment best-practice projects. He was always helping our team figure out how to make deployment easier. Some of us might remember his famous nginx configuration (the closest version I could find). He was an active contributor in the Ruby on Rails Deployment group that I started. He was always around to help the community.

Ezra always seemed to find time for the community… whether on mailing lists, at conferences, commenting on our blogs, or chatting over IRC.

When Ezra and his family moved to Portland, we made several half-assed attempts to schedule time to catch up again in person. It never happened and our interactions were limited to keeping up on Facebook

His passing is a great loss to our community.

To his friends and family, I am sorry for your loss.

To his son, (should you ever discover this), your father helped pave the way for hundreds of thousands (if not millions?) of software developers around the globe—whether they know it or not. He was constantly looking for innovative ways to solve problems. His talks at conferences were always fascinating… and the rest of us would sit back and think, “where does he come up with these ideas?!”

He was a trailblazer.

He will be missed.

Thank you for everything, Ezra.

Update: If you would like to contribute to the memorial fund for Ezra’s son, Ryland, please visit this campaign on indigogo.




Six days to complete the Rails hosting survey

Thu, 24 Apr 2014 09:36:00 -0500

Attention all Ruby on Rails Developers… you have six days to complete the 2014 Rails Hosting Survey.

All of the results will be shared with the community. Consider this your civic duty of the day. :-)

http://rails-hosting.com




Ruby on Rails is like IKEA...whaa?

Wed, 02 Apr 2014 12:14:00 -0500

Recently, I found reading an article by Paul Venezia titled, Fatal abstraction: A bottom-up view of high-level languages, where—if you read between the lines—you can see that Paul just found himself waking up from a coma and it’s no longer 2004.

“I may have questioned Perl’s future now and then, and Perl certainly doesn’t have the presence it once enjoyed, but the strength of Perl has always been its flexibility. You can do pretty much anything with Perl, and you can do it in a wide variety of ways. Perl’s core revolves around the idea that there’s always more than one way to do it. In fact, there may be dozens of ways to do it. PHP shares a similar trait in that it gives you a large set of tools and leaves the construction up to you.

Ruby, and especially Rails, is the opposite, and Python definitely leans more in that direction. Essentially, it’s the difference between building a chair from raw lumber and assembling one from IKEA. This isn’t to say there’s anything wrong with assembling from parts, and clearly Ruby and Python are very capable and strong languages. However, they’re not my cup of tea.”

Admittedly, perhaps I’ve been in drinking the “kool-aid” for far too long, but I thought this tired argument has run it’s course.

I take huge offense to comparing Ruby on Rails to IKEA furniture. It’s far easier to build a web application with Ruby on Rails than it is to build an IKEA bookshelf

“When it comes right down to it, I need to know exactly what my code is doing. I’m going to keep an open mind and spend more time on the other side of the fence in the short term. Perhaps I’ll be won over, but it won’t be easy. Trust issues are complicated.”

Paul, I completely understand where you’re coming from. It sounds like you’re dealing with similar trust issues that I had nearly a decade ago. Trust me, it will be okay.

Ruby on Rails isn’t magic. Behind the curtain you’ll find a collection of object-oriented code written in one of the most readable languages in existence.




2014 Rails Hosting Survey is now open

Fri, 28 Mar 2014 12:13:00 -0500

Hello! It’s been two years since Planet Argon last asked the Ruby on Rails community how they were deploying and hosting their applications and we thought it was time to checkin with people.

Until April 30th, you can take the survey here.




Oh My Zsh gets a proper web page

Sat, 22 Mar 2014 16:48:00 -0500

It was a long time coming… but we finally got a web page designed and deployed for Oh My Zsh.

Check it out! (and tell your friends to ditch bash)




Jr. Ruby on Rails developers

Thu, 27 Feb 2014 12:56:00 -0600

Over on the Planet Argon blog, you can read an enlightening interview with two of our Jr. Ruby on Rails developers. Both of them made a career change in their 30s and went through a coding academy here in Portland, Oregon.

Check it out…




8 Things Github’s Atom Editor is not going to solve for you

Wed, 26 Feb 2014 12:46:00 -0600

(image)

We’re all excited about the prospect of a new code editor (Atom Editor). We all love what Github has produced so far and our expectations for anything new are going to be quite high.

Do we know exactly what it’ll be yet? Not quite. We have some hints… but until it’s released… we’ll continue to speculate.

While I am not one to make predictions—I do have a few theories about what Atom will not do for us. (if you’re looking for a new business idea… feel free to snag any of these)

1. Atom Editor will not make it easier to code while in the shower. While I would love to take advantage of putting my thoughts to code while letting my conditioner do it’s thing… I don’t believe they’re trying to solve this problem (yet).

2. Atom Editor is not going to make it difficult for me to produce shitty code. To date, nearly every code editor on the market is focused on making it easier to produce code…. good AND/OR bad. Where is the editor that tells us to quit while we’re head. “Are you serious, Robby? Have you seen what you’ve been writing today? Just stop. Go outside. Take a break and try again tomorrow.”

3. Atom Editor will not bring synergy to developers.

4. Atom Editor will not change the music playing to compliment the coding problem that I’m faced with. If my tests aren’t passing… I wish my music would keep me calm and focused. This is not a time to start playing WHAM! (…or maybe it is)

5. Atom Editor will not bring about peace in the Emacs vs Vim wars. We are going to have to let them sort a peace deal on their own.

6. Atom Editor will not have integrated CVS or Subversion support when it is released.

7. Atom Editor will not promise the world to you like Visual Studio.NET did back in 2002. I remember their demo videos and it seemed like the development world was about to change! I never would have guessed that come 2005, I’d be in love with something as simple and fancy-feature-less as TextMate.

8. Atom Editor will not just be a clone of Sublime Editor. Github has too clever a team for that objective.

What are you confident that Atom Editor will not be?

Update

8 for 8!




GitHub prepares to release Atom

Tue, 25 Feb 2014 22:35:00 -0600




Jim Weirich -- Farewell, Friend.

Thu, 20 Feb 2014 23:30:00 -0600

It’s been an odd day. The sort of day where you really don’t know what to say. The only thing you can manage to get out is, “Sigh. I’m going to miss him.”

Jim Weirich was building interesting stuff with Ruby several years before I was introduced to it. Tools that most of us have taken for granted. Tools that were just there.

Before Jim came along… they didn’t exist.

Back in the early Ruby on Rails explosion era (circa 2004-2006), it was much easier to get to know the great Rubyists. I remember finally getting a chance to meet Jim (and _why) at FOSCON here in Portland, which still goes down as one of the best “conferences” I have ever attended.

(I think we all knew something special was happening.)

Jim spoke at a ton of conferences. At any conference that I seemed to get invited to speak at… Jim seemed to always be on the speaker list too. We’d end up meeting up on the conference circuit a several times over the coming years. It was always a delight to catchup.

(image) Photo by Obie from Rails Underground 2009

I believe the last one was in 2009 at Rails Underground in London. I remember walking in one of the rooms and spotting Jim. There he was… waiting patiently for his time slot… sitting by the wall in another horribly uncomfortable conference chair… hacking away on his laptop as if he was on a mission to save the human race. In reality, he was probably toying around with some new idea.

As I walked towards him… my red hair must have caught the corner of his eyes… because he looked up and with the warmest of smiles and kindest of voices said, “Robby!”

It’s people like Jim that helped me feel like I had something valuable to contribute to the community. The mere fact that he knew who I was, that he commented on my silly blog posts, referred potential customers to me, showed up for and complimented me on my talks, asked ME for advice on IRC, wished me a happy birthday on Facebook, responded to my lazy tweets… made me feel like I was welcome to (and part of) the party.

A party that started a number of years before I showed up.

Let us raise our glasses high and thank our host for the pleasure of being amidst his most generous company.

Thank you, Jim, for helping me learn more about myself. I only wish I had gotten to know you more.

Adieu l’ami.




Ruby on Rails developers in New York

Fri, 10 Jan 2014 10:51:00 -0600

We’ve had a number of clients in New York over the years. After a recent trip this last fall to visit clients and attend Cultivate we decided that we should spend more of our time in the city.

In 2014, we’re looking to expand our client base there. If you’re in the NYC area and are looking for an agency that has great Ruby on Rails developers… get in touch.




oh-my-zsh reaches over 500 contributors

Sun, 01 Dec 2013 15:29:00 -0600

Earlier today, I noticed that we now have over 500 developers from around the globe who I have accepted pull-requests from1. That is so fantastic.

(image)

Thanks to each and every one of you who has helped make this project so wonderful for others. :-)

1 This number could be a lot higher if I spent more than a hour or two a week on this, but I’m a big fan of slow and steady… a good number of the open pull-requests are themes at the moment.




Reducing MySQL's memory usage on OS X Mavericks

Sun, 24 Nov 2013 10:22:00 -0600

Recently, I found myself re-installing everything from Homebrew and began to notice that MySQL was consuming nearly half a gig of memory. Given that I don’t do too much with MySQL on a regular basis, I opted to override a handful of default configuration options to reduce the memory footprint.

As you can see, a fresh MySQL install via homebrew was consuming over 400mb of memory.

(image)

Here is how I reduced my memory footprint:

$ mkdir -p /usr/local/etc

Unless you already have a custom MySQL config file, you will want to add one into this directory.

$ vim /usr/local/etc/my.cnf

We’ll then paste in the following options into our file… and save it.

  # Robby's MySQL overrides
  [mysqld]
  max_connections       = 10

  key_buffer_size       = 16K
  max_allowed_packet    = 1M
  table_open_cache      = 4
  sort_buffer_size      = 64K
  read_buffer_size      = 256K
  read_rnd_buffer_size  = 256K
  net_buffer_length     = 2K
  thread_stack          = 128K

Finally, we’ll restart MySQL.

$ mysql.server stop

If you have MySQL setup in launchctl, it should restart automatically. After I did this, my MySQL instance was now closer to 80mb.

(image)

So far, this has worked out quite well for my local Ruby on Rails development. Mileage may vary…

Having said that, how much memory are you now saving?




See you at LessConf and RailsConf?

Tue, 09 Apr 2013 11:15:00 -0500

Hey all,

It’s been a while (most of my blogging is over on the Planet Argon blog)... but I’m hoping to have some technical-related posts coming in the near future.

If you’ll be at LessConf in Florida this week, I’ll be there. Do I owe you a drink?

Also, if you’re coming to visit Portland for RailsConf 2013 and will arrive the weekend before, you should join us on a hike. If you can’t make it, be sure to say hello at the conference!

Hope all is well!

Cheers, Robby




2012 Rails Hosting Survey results

Fri, 14 Sep 2012 17:51:00 -0500

A few months ago we invited the Ruby on Rails community to participate in our hosting survey. We’ve since published the results and created an infographic.

To learn more, check out the Rails Hosting site.




2012 Rails Hosting Survey results

Fri, 14 Sep 2012 17:51:00 -0500

A few months ago we invited the Ruby on Rails community to participate in our hosting survey. We’ve since published the results and created an infographic.

To learn more, check out the Rails Hosting site.




GoogleAnalyticsProxy - now minified

Tue, 10 Jul 2012 12:39:00 -0500

It’s been several years since I released GoogleAnalyticsProxy, which allows our team to test their GA event/click/view tracking during the development phases of our project. Today, I pushed a quick update to it with a minified version of the JavaScript so that there is a smaller footprint.

For more information on how we use it, read my older post, Tracking Google Analytics events in development environment with GoogleAnalyticsProxy.




Planet Argon on social media

Thu, 05 Jul 2012 22:36:00 -0500

You can follow along with some of my writing at the following sites:




Setting Akamai Edge-Control headers with Ruby on Rails

Tue, 19 Jun 2012 00:54:00 -0500

Just a short and sweet little tip.

Several months ago we moved one of our clients over to Akamai’s Content Delivery Network (CDN). Ww were previously using a combination of Amazon S3 and CloudFront with some benefits, but we were finding several key areas of the world were not s covered by Amazon (yet) for asset delivery. Along with that, we really wanted to take advantage of the CDN for more of our HTML content with a lot of complex rules that related to geo-targeting and regionalization of content.

I’ll try to cover those topics in another post, but wanted to share a few tidbits of code that we are using to manage Akamai’s Edge-control caches from within our Rails application.

With Akamai, we’re able to tell their Edge servers whether it should hold on to the response so it can try to avoid an extra request to the origin (aka our Rails application). From Rails, we just added a few helper methods to our controllers so that we can litter our application with various expiration times.

  # Sets the headers for Akamai
  # acceptable formats include:
  #   1m, 10m, 90m, 2h, 5d
  def set_cache_control_for(maxage="20m")
    headers['Edge-control'] = "!no-store, max-age=#{maxage}"
  end

This allows us to do things like:

  class ProductsController < ApplicationController
    def show
      set_cache_control_for('4h')
      @product = Product.find(params[:id])
    end
  end

Then when Akamai gets a request for http://domain.com/products/20-foo-bar, it’ll try to keep a cached copy around for four hours before it hits our server again.




Announcing the 2012 Rails Hosting Survery

Thu, 31 May 2012 13:40:00 -0500

You might recall that back in 2009, we surveyed the Ruby on Rails community to gauge how people were deploying and hosting their applications. It’s been over three years, so we’ve decided to run it again…. I know… we’re crazy like that!

(image)

So… without further ado… we present the 2012 Rails Hosting Survey. We’ll be collecting responses for a month, so be sure to put it on your todo list.




A Mobile Site or Responsive Design?

Wed, 30 May 2012 14:45:00 -0500

Our team at Planet Argon just released a white paper on this topic. I’d like to invite you to check it out.




Planet Argon is hiring

Mon, 22 Aug 2011 23:28:00 -0500

Hello all!

I’ve been so busy this year travelling (for pleasure and work) and helping grow the company that I’ve not had much to say here. Expect some posts soon!

In the meantime, if you’re looking for a new challenge… Planet Argon is seeking a few more Ruby on Rails developers. Interested? get in touch.




Announcing RailsDeveloper

Wed, 01 Sep 2010 12:01:00 -0500

Earlier today… our team at Planet Argon launched a new site for the Ruby on Rails community. If you have a few spare minutes, I’d love it if you’d to head over and read the announcement on RailsDeveloper.

Enjoy!




Join the zsh revolution

Thu, 27 May 2010 12:17:00 -0500

I love the OhMyZsh community. Let’s grow it a little more this next Tuesday.

(image)

Join the Zsh revolution here…




Planet Argon Blog

Wed, 17 Feb 2010 09:11:00 -0600

Just a quick update to let you know that I’ll be moving more of my business-related topics to the Planet Argon Blog. I invite you to subscribe to that feed as well. :-)

p.s. We just published Episode 4 of the Planet Argon Podcast, which was on the topic of Hiring designers.




Installing Ruby on Rails, Passenger, PostgreSQL, MySQL, Oh My Zsh on Snow Leopard, Fourth Edition

Mon, 08 Feb 2010 13:14:00 -0600

Welcome to what seems like my tenth installment (actually, it’s the fourth) of showing you how I setup my development environment on a fresh OSX install. In this case, I’m actually getting a MacBook setup for a new employee with Snow Leopard. Over the years, I’ve evolved these following steps and they’ve helped our team maintain a consistent and stable envirnment for Ruby on Rails development. I know that there are a few other ways to approaching this and I’m sure you’ll get similar results, but this approach has allowed me to maintain a hassle-free setup for the last five years. As with all things… your milage may vary. Phase One During this initial phase, we’re going to install the primary dependencies and setup our environment. XCode The first thing that you’ll need to do is install XCode, which almost everything depends upon as this will install developer-friendly tools for you. Apple has been kind enough to ship this on your Snow Leopard DVD. Go ahead and install XCode from the Optional Installs folder. (might require a reboot) You can also download it online. MacPorts Now we’ll install MacPorts, which the web site describes itself as, “an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system.” As I’ve said in past versions of this guide, this tool is about to become one of the most important tools on your operating system. It’ll be used time and time again to maintain your libraries and many of the Unix tools that you’ll be using. If you’re from the Linux or BSD world, you are likely familiar with similar tools… such as: apt-get, port, and yum. You’ll want to download the latest stable version from http://www.macports.org/. Once downloaded, you can install it. Once this is installed, you’ll be able to use the port command from your console. Wget Let’s test out your MacPorts install by installing a useful tool called wget, which we’ll use to install oh-my-zsh. sudo port install wget Git and Subversion Every development environment should have some source code management tools available. We’ll install both of these with one command. sudo port install git-core +svn This will install git and subversion. oh-my-zsh Oh My Zsh is the most amazing thing to happen to shells since… well since I said so. It’s one of my open source projects that I encourage you to give a whirl. wget http://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh That’s it. The next time you open up your terminal, you’ll be running zsh with a bunch of stuff available. For more information, visit http://github.com/robbyrussell/oh-my-zsh. Terminal theme (optional) I never understood why the icon for Terminal has a black background but when you start it up the default theme is black on white. versus Anyhow, I’m a fan of the the dark background. To change this, open up preferences in Terminal. Select Pro, then click on the Default w[...]



(oh my) Zsh themes Gone Wild! 18+

Mon, 28 Dec 2009 00:25:00 -0600

Earlier this evening, I accepted a pull-request for theme number 18, which is now included in Oh My Zsh. To celebrate, I’ve updated the themes wiki page with fresh screenshots.

Here is a sampling of some of the themes that you can use out of the box with Oh My Zsh.

(image)

Oh My Zsh is much more than a collection of themes for your zsh config. It’s a way of life1.

Also, be sure to follow ohmyzsh on twitter now!

1 well.. at least while you’re in the terminal. ;-)




RubyURL goes GOP...

Wed, 16 Dec 2009 23:08:00 -0600

Will refrain from any political commentary, but was notified by some friends that the GOP was using the source code for RubyURL for their new URL shortening site (gop.am).

To celebrate, I decided to daisy chain a few rubyurl-based sites together and came up with:

Enjoy!

As always, you can fork/clone here




Sending email: Controllers versus Models

Mon, 16 Nov 2009 09:33:00 -0600

While reviewing some code recently, I came across controller code that resembled the following.

if @customer.save
  CustomerMailer.deliver_welcome_message(@customer)
  flash[:message] = "Your account has been successfully created. We've sent you a welcome letter with..."
  redirect_to dashboard_path
else
  ...
end

Fairly typical Rails code. Nothing alarming here, but I wanted to evaluate the call to the mailer in this scenario. When it comes to sending emails from your application, you can choose to do it from the controller as in the example above or in your models. Our team prefers to do this from our model via a callback as we are considering this to be part of our business logic.

Each time a customer is created, we want to send them an email. This can be moved into the model and resembled something like the following..

after_create :send_welcome_message #, other callbacks..

def send_welcome_message
  CustomerMailer.deliver_welcome_message(self)
end

There are a few benefits to doing it this way.

  1. We can test that this is being triggered within our model specs instead of our controller specs. (we prefer to spend more of our time working within models than controllers)
  2. We remove the dependency that all requests must be processed through our controllers.
    • Example: We may one day create rake tasks that data and want these emails to still be sent out. (We’ve had to do this a few times)

I definitely don’t think doing this via controllers is a bad idea, I just lean towards keeping controllers as dumbed down as possible. This allows us to have less controller code that is focused on passing data to/from models and letting our models do the heavy lifting.

UPDATE: DHH was kind enough to post a more detailed response on his blog.




Using BETWEEN for SQL comparisons

Sat, 14 Nov 2009 14:55:00 -0600

Recently, Carlos, suggested that I should start sharing some basic SQL tips that help with performance and/or general usage. I recently came across some code that I didn’t like to read and/or write. For example, let’s take the following…


SELECT * FROM brochures WHERE published_at <= now() AND archived_at >= now()

Essentially, this is pulling back some data WHERE the the brochures are considered published. (We have a project that allows people to manage their brochure launch dates ahead of time.) In fact, in this project, we have no less than 6-8 dates in the database that we’re comparing data on and it’s easy to get lost in the logic when trying to understand it.

Now, there isn’t anything inheriently wrong with how this condition is constuctued. As a matter of personal taste, I find it annoying to mentally parse. Also, I find having to write now() more than once in a WHERE clause to feel like I’m repeating myself.

Read it outloud…

“WHERE the brochures published at date is less than and/or equal to right now AND the archived date is greater than and/or equal to now.”

Who talks like that?

Luckily, there is a better and in my opinion, a more readable way to express this is with the BETWEEN construct in SQL. (postgresql docs, mysql docs)


SELECT * FROM brochures WHERE now() BETWEEN published_at AND archived_at

Let’s read this outloud…

“WHERE the current date is between the published at and archived at dates.”

This sounds more natural to me.

Additionally, you can also do the inverse with NOT.


SELECT ... WHERE now() NOT BETWEEN brochures.published_at AND brochures.archive_at

Remember kids, “code is for humans first and computers second.”—Martin Fowler




Launching Ruby on Rails projects, the video

Wed, 11 Nov 2009 12:00:00 -0600

For those of you who didn’t make it to Rails Underground in July to witness my mind-blowing talk, Launching Ruby on Rails projects , it appears that Skills Matter has finally posted a video of it online. :-)

The sound levels are really low… but hopefully you’ll find it helpful.

You can also view the slides.

Related Posts




Planet Argon Podcast, Episode 3: How We Manage Bugs

Wed, 11 Nov 2009 11:46:00 -0600

Earlier this week, we published Episode 3 of the Planet Argon Podcast. In this latest episode we responded to one of the ideas someone in the audience asked on this brainstormr, which was, “How do you manage bugs?”

We had a round table discussion about how we classify and prioritize bugs with our clients, ticketing systems, and other tools that we use to streamline this process.

You can listen to this on iTunes or online.




Tracking Google Analytics events in development environment with GoogleAnalyticsProxy

Sun, 01 Nov 2009 13:55:00 -0600

As mentioned in a recent article1, I’ve been diving deep into Google Analytics lately while working on a few client projects. We’re aiming to use much more of the features of Google Analytics and have been hitting some roadblocks with the development versus production application environments. Once you begin to dive into event tracking and AJAX-driven goal conversions, relying on just the sample code that Google Analytics provides you is going to result in you looking at a handful of JavaScript errors. another example from the firebug javascript console… We see JavaScript errors like this because we don’t load the google analytics code in our development environments. As you can see, we are only loading this in our production environment. <% if RAILS_ENV == 'production' -%> <% end -%> To track an event with Google Analytics, you’d need to trigger something like: pageTracker._trackEvent('Button', 'Click', 'Get in touch'); As you can see from our code earlier, in development, the pageTracker variable isn’t defined and that’s why we’re getting those JS errors. We also don’t want to add conditionals everywhere in our application to check if we’re in development or production environment.. as that’d just make our views uglier than they need to be. So, I decided that I’d create a proxy class in JavaScript that would allow us to trigger _trackEvent() and _trackPageview() and handle it appropriately. This class works with the following logic: if google analytics is loaded, pass the parameters to the real pageTracker if google analytics is NOT loaded, output the information to console.log() for debugging purposes For example, on a gallery on our web site… we track when people navigate next and/or previous through the photos. In our development environment, I can watch the JavaScript console output the following: And in our production environment, we can see that this was sent to Google Analytics. We’re able to do this by initializing the GoogleAnalyticsProxy class and calling these functions through it. For example: _gap = new GoogleAnalyticsProxy(); _gap._trackEvent('Video', 'Play', 'Homepage video'); _gap._trackEvent('Video', 'Pause', 'Homepage video'); _gap._trackEvent('Button', 'Click', 'Call to action X'); You’ll see that we’re just calling _gap versus pageTracker. We then replace all the instances of pageTracker (except [...]



Planet Argon Podcast, Episode 2: The Letter Scotch

Fri, 30 Oct 2009 08:27:00 -0500

Earlier this week our new podcast was approved and is now available in the Apple iTunes Store. We’re also soliciting topic ideas for future episodes on brainstormr.

We posted Episode 2, The Letter Scotch, yesterday for your enjoyment. In this episode, we covered a handful of web browser tools that we use (and detest) to debug HTML, CSS, and JavaScript. This included Web Inspector, Firebug, DebugBar, and a handful of other tools. We all have slightly different preferences, depending on the tasks that we’re working on and the team had an open dialogue about the pros/cons of each of these tools.

You can learn more about and listen to our podcast at http://planetargon.com/podcast.

Thanks in advance for listening!




Planet Argon Podcast, Episode 1: Shin Splints

Thu, 22 Oct 2009 18:50:00 -0500

We’re currently waiting to get our new podcast approved by Apple, but have uploaded episode 1 to tumblr in the meantime.

(embed)

In this short episode, we cover the following topics:

We’re planning to keep this short and focused to a few topics. Once it’s posted on iTunes, we’ll let you know.

Please consider subscribing to the podcast. Enjoy!




Email twice. Four months later

Wed, 21 Oct 2009 17:41:00 -0500

It’s been just over four months since I posted about my experiment, Email. Twice daily. No more, no less. where I shared my plans to restrict myself to checking email only twice a day at designated times. In the post, I had hinted at sharing my lessons months later. So, it’s time to throw my dirty laundry in the street and expose myself.

First off.. the brutal truth. It’s really fucking hard to maintain this. Habits are nearly as hard to make as they are to break. I suspect that I honor my rule 2-3 days each week and it’s completely inconsistent the remainder. Usually, I find myself looking at email at 8:30am and have to slap myself and yell, “what are you doing?!!?”

Guilt sinks in and I hit ⌘-q. Problem solved… for a little while.

So, what has lead to this. Well, one of the biggest hurdles has been that one of our largest clients is now focused more in the United Kingdom. Luckily, I’m an early-morning person, but this means that my 10am PDT rule wouldn’t have me checking for their precious emails until 6pm GMT their time. Not exactly acceptable. So, I’ve been more flexible in the mornings and responding to emails as early as 5-6am PDT. However, I realize that I’m cheating myself of previous focus time and need to recalibrate my email windows.

Given these new constraints, I’m now trying 8:30am and 2:30pm as my primary email times.

I’m curious how this has been working out for you…




RailsOnPg released

Wed, 21 Oct 2009 17:07:00 -0500

Hello fellow PostgreSQL and Ruby on Rails geeks,

Alexander Tretyakov (twitter) recently released a plugin for Ruby on Rails, which extends migrations and provides you with the ability to create.

While you can already do something like this with execute in your migrations:

execute("CREATE VIEW my_tasty_snacks AS SELECT * FROM snacks WHERE food = 'Tasty';")

With RailsOnPage, you’re provided a DSL so that you can do the following:

create_view :my_tasy_snacks do |view|
  view.select     '*'
  view.from       'snacks'
  view.conditions 'food' => 'Tasty'
end

note: I haven’t tested the above, just a hypothetical example

Anyhow, if you’re in the habit of using views, functions, or triggers with your PostgreSQL database and are using Ruby on Rails, you might give RailsOnPg a whirl.




Tracking AJAX-driven events in Ruby on Rails for Google Analytics conversion goals

Wed, 21 Oct 2009 13:09:00 -0500

Tracking your KPI’s is extremely important in your online venture. At a minimum, you should be using something like Google Analytics to track conversions in your application. Setting up goals is actually quite simple, especially if you’re just tracking that specific pages are loaded. However, if some of your conversion points occur through AJAX, you might not be capturing those activities in Google Analytics. Lucky for you, it’s actually quite simple to update this. I thought I’d show you a fairly simple example to help you along. On our web site, we have a mini contact form at the bottom of many of our pages. When submitted, if JavaScript is enabled, it’ll perform an Ajax request to submit the form. If you fill out the main Get in Touch form that gets processed and we redirect people to a thank you page. The URL for that is unique and we’re able to track those in Google Analytics quite easily. However, with the Ajax-form, the URL in the browser isn’t going to change so Google Analytics isn’t going to track that conversion. So, we needed to track that properly. To do this, we just need to call a JavaScript function that the Google Analytics code provides you. pageTracker._trackPageview("/contact_requests/thanks"); Let’s look at some simple code from our controller action. If the request is from JavaScript, we currently replace the form area with the content in a partial. (note: if you’re curious about the _x, read Designers, Developers and the x_ factor) respond_to do |format| format.html { redirect_to :action => :thanks } format.js do render :update do |page| page.replace :x_mini_contact_form_module, :partial => 'mini_contact_form_thanks' end end end As you can see, the redirect will within the format.html block will lead people to our conversion point. However, the format block will keep the user on the current page and it’ll not trigger Google Analytics to track the conversion. To make this happen, we’ll just sprinkle in the following line of code. page.call 'pageTracker._trackPageview("/contact_requests/thanks");' However, if you need to do something like this in several locations in your application, you might want to just extend the JavaScriptGenerator page. GeneratorMethods. (you could toss this in lib/, create a plugin, etc…) module ActionView module Helpers module PrototypeHelper class JavaScriptGenerator #:nodoc: module GeneratorMethods # Calls the Google Analytics pageTracker._trackPageview function with +path+. # # Examples: # # # # Triggers: pageTracker._trackPageview('/contact_requests/thanks'); # page.track_page_view '/contact_requests/thanks' # def track_page_view(path) [...]



The 8-Hour Rails Code Audit

Tue, 20 Oct 2009 07:13:00 -0500

While our team is typically focused on larger client and internal projects, we do get an opportunity to assist businesses on a much smaller scale. Whether this be through retainer-based consulting or through code audits, we have seen a lot of Ruby on Rails code over what has nearly been… five years!? We’ve been able to compile a fairly extensive checklist that we use in our code audit process that we’ve decided to streamline it into a smaller product.

Historically, this service has ranged anywhere from $2000-6000, depending the size and scope of the projects, but we want to help smaller startups1 and projects outline a roadmap for how they can begin to refactor and optimize their existing code base so that they can be more efficient at the start of 2010. So, we’ve scaled things down into an extremely affordable flat-rate package where we work off of a pre-defined number of hours.[2]

Through the end of 2009, we’re now offering the 8-Hour Rails Code Audit package for just $1000 USD (details).

We’re currently limiting this service to just two projects per week, so reserve your spot now.

1 Larger projects are welcome to benefit from this service and custom quotes are available upon request.

2 As always, we’re happy to discuss longer engagements.

Related Posts




Flash Message Conductor now a Gem

Tue, 13 Oct 2009 10:30:00 -0500

We’ve been doing some early (or late… if you’re a half-full kind of person) spring cleaning on some of our projects. One of the small projects, flash_message_conductor, which we released last year as a plugin is now a gem. We’ve been moving away from using plugins in favor of gems as we like locking in specific released versions and being able to specify them in our environment.rb file is quite convenient.

To install, just run the following:


  sudo gem install flash-message-conductor --source=http://gemcutter.org
  Successfully installed flash-message-conductor-1.0.0
  1 gem installed
  Installing ri documentation for flash-message-conductor-1.0.0...
  Installing RDoc documentation for flash-message-conductor-1.0.0...

You’ll then just need to include the following in your config/environment.rb file.

Rails::Initializer.run do |config|
  # ...
  config.gem 'flash-message-conductor', :lib => 'flash_message_conductor', :source => "http://gemcutter.org"
end

You can take a peak at the README for usage examples.

We’ll be packaging up a handful of our various plugins that we reuse on projects and moving them to gems. Stay tuned… :-)




Oh My Zsh gets an auto-updater

Wed, 30 Sep 2009 21:21:00 -0500

I wanted to publically thank everyone for helping me get Oh My Zsh out there and continue to improve it. Many of us spend a lot of time in our terminals throughout the day and I firmly believe that having a well-working shell is nearly as important as having a well-working texteditor.

While Oh My Zsh isn’t a large project, it is my attempt to share what I’ve learned about using zsh with others… but honestly, my goal is to learn from you. I don’t have a lot of time to really dive into the deepend of the zsh-pool so am relying on others to share their tricks, hacks, functions, themes, etc. So, I thought that if I created a basic framework with outlined some conventions so that others could contribute, that perhaps I’d end up with a kickass shell.

So far… Oh My Zsh has been forked on github 25 times and is being watched by over 100 people.

Last week, I pushed out an update that introduces an auto-update feature. I’m quite keen of desktop applications that can auto-update themselves, so our initial version of this feature will ask you no more than once a week if you want to check for updates. This means that as we continue to extend and improve Oh My Zsh, you can keep up-to-date.

(image)
Uploaded with plasq’s Skitch!

It’s the beginning of a new month… are you still using Bash? Perhaps you’re using your own zsh configuration but want to see what else zsh can offer you? I invite you to install Oh My Zsh today. :-)

Just run this in your terminal and you’ll get setup. Don’t worry… you won’t lose your existing configuration. :-)

wget http://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

For more infromation, visit http://github.com/robbyrussell/oh-my-zsh/




Planting the seeds

Sat, 05 Sep 2009 08:00:00 -0500

Yesterday, the Rails team released 2.3.4, which includes standardized way for loading seed data into your application so that you didn’t have to clutter your database migrations. I noticed a few comments on some blogs where people were asking how to use this new feature, so here is a quick runthrough a few ways that you can use it. Populating Seed Data Approaches The db/seeds.rb file is your playground. We’ve been evolving our seed file on a new project and it’s been great at allowing us to populate a really large data. Here are a few approaches that we’ve taken to diversify our data so that when we’re working on UI, we can have some diversified content. Basic example Any code that add to db/seeds.rb is going to executed when you run rake db:seed. You can do something as simple as: # db/seeds.rb Article.create(:title => 'My article title', :body => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit') Just create database records like you would in your Rails application or in script/console. Simple enough, right? Let’s play with a few other approaches that we’ve begun to use. Use the names of real people We’re using the Octopi gem to connect to github, collect all the names of people that follow me there, and using their names to seed our development database. @robby_on_github = Octopi::User.find('robbyrussell') # add a bunch of semi-real users @robby_on_github.followers.each do |follower| github_person = Octopi::User.find(follower) next if github_person.name.nil? # split their name in half... good enough (like the goonies) first_name = github_person.name.split(' ')[0] last_name = github_person.name.split(' ')[1] new_person = Person.create(:first_name => first_name, :last_name => last_name, :email => Faker::Internet.email, :password => 'secret', :password_confirmation => 'secret', :github_username => follower, :website_url => github_person.blog) # ... end We do this with a few sources (twitter, github, etc..) to pull in the names of real people. If you want to be part of my seed data, you might consider following me on Github. ;-) Use Faker for Fake data You may have noticed in the previous code sample, that I used Faker in that code. We are using this a bunch in our seed data file. With Faker, you can generate a ton of fake data really easy. person.links.create(:title => Faker::Lorem.words(rand(7)+1).join(' ').capitalize, :url => "http://#{Faker::Internet.domain_name}/", :description => Faker::Lorem.sentences(rand(4)+1).join(' ')) We might toss something like that into a method so that we can do the following: @people = Person.find(:all[...]



Oh My Zsh gets theme support

Mon, 31 Aug 2009 10:00:00 -0500

I just pushed a small change to Oh My Zsh, which gives it rudimentary support for themes. What I’m hoping to do is collect prompts from tons of people and make it simple for others to find a PROMPT that works well for them.

As of right now, there are only three for you to choose from. So, please head over to github, fork Oh My Zsh, add your theme, and send a pull request. :-)

Once I get it merged in, we’ll get a screenshot of it added to the Oh My Zsh wiki. (see themes)

I know that many of you have some really sweet prompts configured as I got a lot of response with my post, Show me your and I’ll show you mine.




..and on the seventh day, Science created zsh

Sun, 30 Aug 2009 20:08:00 -0500

Inspired by some recent posts from Tom on zsh, I decided that I’d do my part to help people give it a whirl. I’ve been using zsh for a few years now and haven’t found myself missing bash.

If you’re interested in taking a few minutes to give zsh a while, you’re in luck. I recently reorganized all of my zsh config into a package and tossed it on github to share. My goal was to create a reusable tool that would allow people to get up and running quickly with some of the fun configuration that I’ve come to rely on on a daily basis.

For example:

  • Auto-complete rake and capistrano tasks
  • Git branch names when you’re in a git project directory structure
  • Tons of color highlighting (grep, git, etc.)
  • Sexy prompts.. (so say me)
  • much much more…

I invite you to give Oh My Zsh a whirl, which should take you less than a minute. Just follow the instructions.

Also, Oh My Zsh is Snow Leopard compatible. ;-)




So long and thanks for all the hoodwinks

Thu, 20 Aug 2009 00:24:00 -0500

_why,

If you’re out there and come across this… know that one of my fondest memories on the internet was with you. Hoodink.d was one of the greatest things on the internet four years ago and I suspect that a very tiny fraction of the Ruby community has even heard of it.

(image)

Fortunately for me, I have a copy of the hoodwink git repository and was able to get it running tonight in hopes that I might find you lurking in the mousehole. I’m convinced that you are in a parallel internetverse. Perhaps you might send me an invite.

(image)

I miss hoodwink… and if you stay missing, I’ll just miss hoodwink more.

In the meantime, I wonder how hard it’ll be to get hoodwink to run on rack.

(image)

Wink you on the other side, Robby

p.s. you can find me in my own mousehole… should you want to send me an invite and/or feed me cheese.

Related Posts