Today’s tip is a simple mounted uploader. I started using CarrierWave in this application and need a way to get my image out as a Base64 encoded string. class Post < ActiveRecord::Base attr_accessible :caption, :image, :page_key, :store_id, :public_url belongs_to :page mount_uploader :image, ImageUploader   def encoded Base64.encode64(open(image.current_path){ |io| }) end   end I skipped the CarrierWave setup stuff as the Readme is pretty good, but the important part is to open the block and access the read method. This will return the correct string. :)

The Rails infrastructure is my homeland, but so many sites that come my way are based on WordPress. This site is a WordPress site, but not for long. It is a shame to try and rewrite the entire WordPress system in Rails, but my days of developing WordPress plugins has shifted to creating Ruby Gems. As part of my Ruby Tips series my next idea will be to interface with Evernote as a text editor and entry point of my writings. This will involve moving everything from this site to a new application and then creating an interface with Evernote. My tip today is a simple parse of my WordPress XML with the Nokogiri gem. Nokogiri is not new, but[…]

This post will teach you how to set up a local development environment to manipulate and create your web applications using the WordPress code base. A few years ago the status quo for getting a development environment for PHP applications was to use MAMP – Mac, Apache, MySQL & PHP. This worked fine until I started doing Ruby development and specifically use Ruby on Rails for my daily development. There are many reasons why I do not like MAMP, yet is this post is not about any. This post is about an alternative set up a development environment for WordPress, or other PHP applications, on a new MAC with OSX Lion – without MAMP. Part 1 – Apache and PHP 1) Get Apache activated[…]