Preventing Chrome on Android and Safari on iOS From Allowing Zoom

Posted on April 29, 2013 in #software development / #web development

One of the most common themes with mobile web applications is disabling zoom in the browser. Using viewport meta tags can get tricky pretty quickly when a lot are in use. Some conflict with others and can cause confusion. After searching around online it was evident that others were having trouble disabling zoome across iOS and Android, too. The following CSS will effectively disable zoom on both Safari on iOS and Chrome on Android.

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

Catching Swiftype When It Falls

Posted on April 07, 2013 in #rails / #software development / #web development

I've been a huge fan of Swiftype for a while now and have been using it since its beta days. Recently, however, it seems that the availability of its API has decreased causing the Rails gem to throw exceptions. The API will return various HTTP 500 status codes throughout the day. I have been getting multiple emails every day from Rollbar notifying me that the Swiftype gem was throwing exceptions. I can only assume that the folks over at Swiftype are deploying broken code at the most inopportune times of the day. It's gotten so bad, in fact, that I've had to add backup searching capabilities to one of my websites. While searching using a simple SQL LIKE query won't be as good as the results Swiftype gives, I can at least ensure that it's going to be up as long as my website is up. One can only hope that Swiftype will mature and become much more reliable in the future.

For those interested, I'm just catching the exceptions thrown by the Swiftype gem and then searching manually.

client = Swiftype::Easy.new
@results = client.search(ENV['SWIFTYPE_ENGINE_SLUG'], params[:q], {:per_page => '10', :page => params[:page] || 1})
@book_results = @results['book']

if (@book_results.empty? == false)
  @books = Array.new

  # Build an array of AR models for the view.
  @book_results.each do |ar|
    @books << Book.find(ar.external_id)
  end
end

rescue Exception
  # Swiftype API failed. Manually search on a book's title and its author's display name.
  query = params[:q].downcase
  @books = Book.joins("LEFT JOIN users ON books.user_id = users.id").where("lower(users.displayname) LIKE ? OR lower(books.name) LIKE ?", "%#{query}%", "%#{query}%")
end

Forms Refusing to Submit in Internet Explorer

Posted on March 30, 2013 in #software development / #web development

After launching a recent website I had a few users report that the website was "freezing" while submitting a form. The only users to report this happened to be Internet Explorer. After poking around I found some very peculiar behavior with file upload input elements. The file upload tags were actually causing the forms not to submit!

Since most browsers have their own file upload style, I wanted something more consistent. Luckily someone released a pretty straight forward file upload that looks great with Bootstrap called Pretty File. Pretty File works by hiding the underlying input element and using its own text field and button. When a file is selected the underlying input value is changed. This works fine in IE however, the form refused to submit. It was then clear that even if the file upload's value is changed, IE absolutely requires the user to click the file upload and select a file and the value cannot be changed later.

The ultimate solution in my case was to only use the Pretty File implementation if the user is accessing my website in anything but IE.

Year in Review: 2012

Posted on December 31, 2012 in #life

Today marks the last day of the year and also my 21st birthday. Simply put, this past year has been awesome. I was able to accomplish things that I never knew I would be able to do at such a young age. So many great things have changed this year and I couldn't be happier with how it all turned out. In addition to all of my accomplishments this year, 2012 has been an amazing year for my beloved Atlanta Falcons! Take a look at the timeline below to see some of my personal favorite accomplishments from this past year.

Here's to an amazing 2013!

  • JAN
  • FEB
  • MAR
  • APR
  • MAY
  • JUN
  • JUL
  • AUG
  • SEP
  • OCT
  • NOV
  • DEC

My Word - Jet Life

Posted on November 27, 2012 in #music

Easily my favorite track off of the new album Jet World Order 2 by Trademark and Young Roddy.

"Matchmaker" by Hotels.com

Posted on November 16, 2012 in #entertainment

Probably the best commercial on television right now. A clear message backed by great music. Hotels.com hit it out of the park with this one.

Attitude

Posted on November 12, 2012 in #life

Whether you think you can, or you think you can't -- you're right.

Fantastic quote by Henry Ford.

So Long, and Thanks for All the Fish

Posted on September 01, 2012

Seven years ago, I started vbdotnetforum.com as an exchange for people to discuss Visual Basic .NET. Since iOS came out, my interest in VB.NET completely went away. I no longer have time to maintain the forums and I am finally shutting them down. The forums have been neglected for the past five years and closing them is the most logical thing to do.

Thanks to every member who was active in the community over the past years.

Paperclip NotIdentifiedByImageMagickError on OS X 10.8

Posted on July 30, 2012 in #mac os x / #rails / #software development

After upgrading to Mountain Lion, Paperclip attachments weren't post-processing properly in a Rails application. The application was logging Paperclip::Errors::NotIdentifiedByImageMagickError whenever an attachment was saved. Luckily, there was quite an easy solution since I use homebrew.

First off, I removed ImageMagick since it has a dependency that doesn't ship with 10.8 with brew rm imagemagick. Then, I had to install the latest version of XQuartz because it doesn't come with 10.8 by default. Finally, after installing ImageMagick again with brew install imagemagick I was able to successfully post-process image attachments with ImageMagick.

Command Line Git Completion

Posted on June 04, 2012 in #mac os x

Since I have yet to find a Git client for OS X that suits me well, I use the shell tools to work with Git. As is always the case with doing anything within a shell, it's tough sometimes to remember the exact names of things. Luckily, there's a great shell script someone contributed to Git called git-completion that'll help with completion. To use git-completion, save the shell script and reference it from your .bash_profile. You can either directly place git-completion in your .bash_profile or import it as follows:

source ~/.bash/git-completion.sh

A variety of things can now be autocompleted including branch names. For example, if you type "git checkout ma<TAB>", git-completion will autocomplete "master".