PLANET ARGON blog

Yoga on Planet Argon

22 Jan 2015

Anyone who has used a computer keyboard as their primary tool of the trade knows the aches and pains that come with it; the achey wrists, tight forearms, stiff shoulders, maybe even some lower back pain from sitting in that “ergonomic” desk chair. Or perhaps you are more familiar with the 3pm slump? The time of day when you begin to start looking for a cookie or search for a comfy spot to take a nap.

At Planet Argon, we’re no strangers to these aches, pains and nap-attacks. That’s why we’ve started combatting it with yoga twice a week. In the afternoons, we stand up and spend about 20 minutes creating space in our joints and between our bones, stretching our muscles and breathing deeply. Every one of us has different aches, different levels of flexibility and varying experience with yoga but we all benefit from the simple action of getting up and moving around.

Some of our regular moves include:

These are some simple moves that, done with regularity, can heal and even prevent those pains and give a jolt of energy without grabbing a cookie or a quick slumber. We can do all of these without a yoga mat and it doesn’t even require you to wear stretchy pants (though you can if you want, we won’t judge).

Watch this short documentary about Aaron Draplin in his element

22 Dec 2014

Earlier this year, I had the good fortune of seeing Aaron Draplin of Draplin Design Co. speak at TEDxPortland. This short documentary series that Vans put together captures him in his element. Totally worth your time to watch these.

Happy Holidays, New Relic!

18 Dec 2014

Happy Holidays, New Relic!

Our partners at New Relic sent us some new shirts. Thanks!

Happy Holidays, Engine Yard!

16 Dec 2014

Happy Holidays, Engine Yard!

Our friends at Engine Yard sent us a box of goodies. Happy Holidays!

Around we go

24 Oct 2014

Around we go

Am convinced that an ideal team size is one that can still fit together on a park carousel.

How are vinyl records pressed?

25 Aug 2014

Colby Aley, another talented 17 year old engineering intern in high school.

21 Aug 2014

The Retrospective Trifecta

19 Aug 2014

The Retrospective Trifecta

Continue reading …

The Results of the 2014 Rails Hosting Survey are in!

31 Jul 2014

We are proud to announce that we have released the results for the 2014 Ruby on Rails Hosting Survey! This year was an interesting challenge for us because we decided to display the results from previous years along with this year’s data.

How did we do that, you may ask? Charts! If a question was asked in a previous year, the viewer may switch the active color of the chart to highlight the data for that specific year. Neat-o!

We’ve made comments about what has changed throughout the years, but we want you to play around with the data and compare.

Thank you to everyone who participated this year!

Take a look at the Ruby on Rails Hosting Survey 2014.

Continue reading …

An Incremental Migration from Rails Monolithic to Microservices

23 Jun 2014

Using Named Scopes Across Models with ActiveRecord#Merge

23 May 2014

AlphaClone Making the Cover

12 May 2014

AlphaClone Making the Cover

When looking for an "expert" on things like stocks and investing, it's no surprise that Barron's, America's premier financial magazine, would turn to our partner at AlphaClone, Mazin Jadallah, for some advice (we would too!). Lookin' good Maz!

Video Testimonial: Oregon Coast Aquarium

1 May 2014

One of our wonderful clients, Marsh Myers, from Oregon Coast Aquarium shares his experience of working with Planet Argon on their Science education platform for Oregon high school students.

Video Testimonial: McMenamins

22 Apr 2014

Learn why Jon Sokol of McMenamins, Inc. continues to partner with Planet Argon to take on the long-term maintenance and evolution of McMenamins’ web presence.

Video Testimonial: Open City Freight

21 Apr 2014

Learn why Robert McGinnis of Open City Freight partners with Planet Argon.

The Weekly Orbit - April 14-18

18 Apr 2014

Topics discussed in the chat room this week

Continue reading …

8 Insanely Useful ActiveAdmin Customizations

14 Apr 2014

Getting a Grasp on Scope in Javascript

11 Apr 2014

Easily add canonical URLs to your Rails app

4 Apr 2014

There has been a lot of talk lately about canonical URLs and how Google and other search engines would really prefer if you would use them. So, what is a canonical URL and why should you use them?

Continue reading …

On being "agile"

4 Apr 2014

The Weekly Orbit - March 24-28

28 Mar 2014

What we’re talking about

Continue reading …

Take the 2014 Ruby on Rails hosting survey

28 Mar 2014

It’s time to take the pulse of the Ruby on Rails hosting ecosystem again.

Continue reading …

Testing Chargify Direct with Capybara WebKit

28 Mar 2014

An overview of how we're using Capybara Webkit to mock Chargify for a Ruby on Rails application.

Continue reading …

Fixing Wordpress URLs When Using Rack

27 Mar 2014

In my last article I detailed how to run PHP through a Rack server. This works fairly well until you try to sign into the Wordpress admin section.

The problem is that Wordpress stores site URLs in the database and it will use these for some redirections. Luckily, with a few Rake tasks you can painlessly override them.

I borrowed some conventions from Rails and created a config/database.yml file. This is your run of the mill database connection file, nothing special here.

From there I created a Rakefile in the root of the project titled rakefile.rb.

I've been spoiled by Rails' database Rake tasks so I decided to build my own using ActiveRecord.

Here are the Rake task components that setup the ActiveRecord connections:

require 'yaml'
require 'logger'
require 'active_record'

namespace :db do
    def create_database(config)
        options = { :charset => 'utf8', :collation => 'utf8_unicode_ci'}

        create_db = lambda do |config|
            ActiveRecord::Base.establish_connection config.merge('database' => nil)
            ActiveRecord::Base.connection.create_database config['database'], options
            ActiveRecord::Base.establish_connection config
        end

        begin
            create_db.call config
        rescue ActiveRecord::StatementInvalid => exception
            puts "There was an error creating the database. The error is: #{exception.message}" and return
        end

        puts "Database #{@config['database']} was created."
    end

    task :environment do
        DATABASE_ENV = ENV['DATABASE_ENV'] || 'development'
    end

    task :configure_connection => :configuration do
        ActiveRecord::Base.establish_connection @config
        ActiveRecord::Base.logger = Logger.new STDOUT if @config['logger']
    end
end

Now that we have that out of the way, we can create our database create and drop table tasks. I put these in the db namespace.

desc 'Create the database from config/database.yml'
task :create => :configure_connection do
    create_database @config
end

desc 'Drops the database'
task :drop => :configure_connection do
    begin
        ActiveRecord::Base.connection.drop_database @config['database']
    rescue MySql2::Error => exception
        puts "There was an error dropping the database. The error is: #{exception.message}"
    else
        puts "Database #{@config['database']} was dropped."
    end
end

Now we can create and drop our database with the familiar commands of rake db:create and rake db:drop.

There is only one more thing to do and that's fix the Wordpress site URL references. I added the following task to the db namespace:

desc "Set Wordpress URL's to localhost"
task :fix_wordpress_urls => :configure_connection do
    begin
        ActiveRecord::Base.connection.execute(
            "UPDATE wp_options SET option_value = 'http://localhost' WHERE option_name IN ('siteurl', 'home');"
        )
    rescue ActiveRecord::StatementInvalid => exception
        puts "There was an error fixing the Wordpress URLs. The error is: #{exception.message}"
    else
        puts "Wordpress URLs have been fixed."
    end
end

With that final task we can now run this command:

rake db:fix_wordpress_urls

Now our Wordpress instance is ready to be run through Rack.

Final Thoughts

This is how I thought to manage this particular PHP/Wordpress hurdle in a Rails dominated environment. Hopefully some of you can apply this, and let us know if you have any other clever solutions.

Brief mention in the Portland Business Journal

26 Mar 2014