Archive

Archive for the ‘Programming’ Category

Git aliases

January 12th, 2010 Michael Comments off

I’m constantly passing a list of git aliases I use in my terminals.  Here they are:


alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gd='git diff | mate'
alias gl='git pull origin master'
alias gp='git push origin master'
alias gst='git status'

Categories: How-To, Linux, Mac, Open Source, Programming, git Tags:

Comparing arrays in Ruby

January 6th, 2010 Michael Comments off

There are a number of instances where you may find yourself with two arrays and you need to find the values that do not exist in both.  This is fairly simple:

For these two arrays:

a = ["rockets", "saucers", "underwater", "warp"]
b = ["saucers", "fuel", "moon", "warp"]

A simple way to do this is to put the two arrays together and then remove the items that exist in both:

(a | b) - (a & b)

Gives you:

["rockets", "underwater", "fuel", "moon"]

Categories: How-To, Programming, Rails, Ruby Tags:

Installing Rmagick on Ubuntu 9.04

August 17th, 2009 Michael Comments off
sudo aptitude install -y imagemagick
sudo aptitude install -y libmagick9-dev
sudo gem install rmagick
Categories: Linux, Open Source, Programming, Rails, servers Tags:

Ruby on Rails 2.3

March 16th, 2009 Michael Comments off

From the Riding Rails blog:

Rails 2.3 is finally done and out the door. This is one of the most substantial upgrades to Rails in a very long time. A brief rundown of the top hitters:

Templates: Allows your new skeleton Rails application to be built your way with your default stack of gems, configs, and more.

Engines: Share reusable application pieces complete with routes that Just Work, models, view paths, and the works.

Rack: Rails now runs on Rack which gives you access to all the middleware goodness.

Metal: Write super fast pieces of optimized logic that routes around Action Controller.

Nested forms: Deal with complex forms so much easier.

And that’s just the tip of the iceberg. We’ve put together a complete guide for the Rails 2.3 release notes with much more information. Be sure to checkout the section on what was deprecated when you’re ready to upgrade your application.

You install 2.3 with (the final version is marked 2.3.2):

gem install rails

If you’re running on Passenger, be sure to upgrade to 2.1.2 as well. Rails 2.3 doesn’t run on older versions of Passenger!

We hope you’ll love it.

Categories: Programming, Rails Tags:

Xcode color bliss

January 7th, 2009 Michael Comments off

Thanks for the tip from @al3x on the XThemes tool.  I love the midnight theme in textmate and now my eyes are happy in XCode.

Categories: How-To, Mac, Programming, Xcode, apple Tags:

Upgrading to rails 2.2

November 22nd, 2008 Michael Comments off

We’re busy testing our apps on rails 2.2 now that it’s out.

Things are going very well. We’re here to help you with yours if you need us, send an email to support@imapenguin.com

Categories: How-To, Programming, Random Cool Stuff, Ruby Tags:

We’re switching to passenger

August 27th, 2008 mike Comments off

Mongrel has served us well for the past year or so, but the simplicity of deployment in passenger along with the ever reliable apache has lured us into extensive testing. We’re getting slightly better performance numbers from passenger over mongrel with about 2/3 of the memory footprint. Please let us know at support@imapenguin.com if you see any wonkyness with any of our services. As we migrate over night.

Github takes a stab at social code review and we like it

July 22nd, 2008 mike Comments off

github

So we all use some pasting service, but check out Gist, from Github. Each paste gets it’s own git repository. I’ve been using it all morning and love it.

Some cool features:

  • Multiple revisions
  • multiple files in a “gist”
  • Forking
  • Offline use via git
Categories: Programming, Random Cool Stuff Tags:

Ruby Vulnerabilities

June 23rd, 2008 mike Comments off

Ruby logo

Bleh, there are some nasty ruby vulnerabilities out in the wild right now. Details are here. We’ll post an update as Linux distributions get patches to let you know who needs to take action to get fixes.

We’re compiling ruby from source for the time being on production machines until updates appear.

If you need help, it’s support@imapenguin.com

Categories: Programming, Ruby, Security, servers Tags:

Capistrano Git Deploy Issue

May 29th, 2008 mike Comments off

There is a bug in the capistrano git bridge that’s not been patched in the stable version yet.

If you’re getting:

fatal: Could not parse object

A quick and dirty hack is to add a task that just removes your git cache for now on the deployed server with:

desc "Clear that git cache"
task :clear_git_cache do
  run "rm -Rf /#{deploy_base}/#{application}/shared/cached-copy"
end

before "deploy", "clear_git_cache"

It takes about 1 second longer to do the checkout but I don’t really notice.

Categories: Programming, Rails, Ruby, servers Tags: