David DeGraw

Read this first

Use griddler to receive emails as http post events from Mandrill in Rails

Much of this post is based off of SendGrid’s great tutorial that can be found here. However, I found that some of the contents were outdated. Additionally, I wanted to use mandrill instead of SendGrid.

At times, it may be necessary to receive an email in your rails app as an incoming post event. Fortunately, this problem has been solved and the solution is relatively simple to implement.

Set up Griddler

Add the griddler gem and the mandrill adapter to your gemfile:

gem 'griddler'

gem 'griddler-mandrill'

Now, we need to add just a little bit of code that griddler needs. First, set up the griddler routes. This is very simple; add mount_griddler to the top of your routes.rb

Next we need to set up a few griddler initialize parameters. Create a new file in config/initializers/griddler.rb and put this code in it:

griddler.rb

This code may be somewhat redundant because these are all the default...

Continue reading →


Ruby notes

It is usually better to use ! rather than the more explicit == false.

When using .try with a method that takes options, pass them into try separated by commas:

.include?(q) becomes .try(:include?, q)

View →


Safari VS Chrome: An Experiment

I’m a huge Google fanboy. I’ll disclose that right now. But when it comes to hardware, you just can’t beat a macbook. And really, when it comes to full featured OS, you can’t beat OSX. One thing has always bothered me though, petty as it may be. The “Apps using significant energy” bar, Chrome is always at the top of the list. I wouldn’t put it past Apple to be straight up lying about that, it’s not like they haven’t done something similar before.

So just wanted to see for myself the difference. For one day i will be using only Safari. These are my notes on the experience.

Right off the bat:
Right away there’s a few things bothering me. There is too much clutter in the nav bar.
Screen Shot 2014-06-06 at 10.15.43 AM.png
I don’t care about any bookmarks. Kill that please. I don’t care about sharing, iCloud, reader, or really even downloads. Kill them. I do care about my tabs, but unfortunately they’re small and seem underplayed...

Continue reading →


Hints on Savon and Rails

So I had to use the Savon gem recently, and there’s a couple pitfalls that aren’t super well documented.

There’s a couple great resources for learning however. Most notable are the Savon docs themselves and Ryan Bates’ RailsCasts. Keep in mind that Ryan Bates is using an older version of the gem, so refer to the docs for syntax.

Before you tear into your SOAP integration, you may do well to make sure the api responds expectedly using wsdlbrowser.com. That will give you a list of available actions (granted you can do that with Savon too). Stay away from SOAPui that Ryan Bates recommends. In my experience it was totally unusable on Mac OS 10.9. That and it’s probably a little too feature heavy for your average SOAP integration. YMMV.

The biggest pitfall I came across was that Savon will not do anything unless you have httpclient also installed. This is not in the Savon docs at all, I...

Continue reading →