/blog/index.xml

7 ways to make the best use of your freelance programmer

7 ways to make the best use of your freelance programmer

Getting the most out of your freelancing programmer can be one of the best moves you make! Save yourself time and money with this valuable guide!

There are certain things that you can do right or wrong that cannot only end up costing you time and money, but it can also cost you a valuable freelancing programmer. It is important that you understand the best ways to get the most out of your freelance programmer. In the following article, we will discuss seven of the best ways to get the most out of your freelancer!

Read More

Add Rubocop to every Rails project

The longer I have been in programming, the more I think that following best practices for coding style is an essential quality of a good programmer. When working on a team, I find many people want to debate about these things. While this can be fun, after a while it can become a time suck and a waste of energy. The best thing is to simply agree on a standard style guide and conform to it.

Read More

My Heroku Cheatsheet

My Heroku Cheatsheet

You can find all this in the Heroku docs, I’m just filtering out the stuff I use very frequently. I will keep updating this so check back later. ALl of my examples include the -a myapp at the end because 95% of my apps have both staging and production environments so I have gotten in the habit of using this option.

Heroku Postgres DB

Download current database:

heroku pgbackups:capture --expire
curl -o latest.dump `heroku pgbackups:url`
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d myapp_development latest.dump

Read More

In Ruby, classes are cheap

In Ruby, classes are cheap

Developers coming from Perl or Php often bring conventions from those languages into Ruby. One important thing I like to tell new Ruby developers is that classes in Ruby are cheap so use them liberally. Ruby is an Object Oriented language and objects are the best way to communicate your intent to future developers reading your code. Let’s look at examples of where a class is more appropriate.

First, we have a method returning multiple values for status.

class ExternalOrderService
  def handle_order(order_status)
    # stuff here
    if order_status.include?('Fail on Shipment')
      message = 'Order Failed because of Shipment'
      success =  false
    elsif order_status.include?('Order Processed')
      message = 'Order Failed because of Shipment'
      success =  false
    else
      message = 'Order Failed for unknown reason'
      success =  false
    end
    [message, success]
  end
end

Read More