Reading, Writing, Removing Files and Directories in Ruby
These aren't all of them, but I think they are some of the most useful.
# making a directory in another directory that doesn't yet exist...
FileUtils.mkdir_p '/path/to/your/directory/that/doesnt/exist/yet'
# recursively remove a directory and the conten...
Written by Sean Behan on 06/17/2012
How To Export A MySQL Database to JSON, CSV and XML with Ruby and the ActiveRecord Gem
It's trivial to export data from a mysql database with Ruby and ActiveRecord. All you have to do is establish a connection and define a class that represents the table.
require 'rubygems'
require 'active_record'
ActiveRecord::Base.establish_con...
Written by Sean Behan on 06/23/2012
How To Flush Your Permalink Structure in Wordpress When Using Taxonomies ...or Wordpress Taxonomies Not Working Instead I See A 404 Page
I didn't know this, but because of a linking problem using custom taxonomies in Wordpress, I was forced to find out. If you create a new taxonomy, it will not work immediately on the front facing end. Your users will be greeted by a 404, page not found in...
Written by Sean Behan on 06/17/2012
How To Use Rake to Run Your Test Suite with Sinatra
If you're using Sinatra and you want to use rake to run your test suite, you will need to create a Rakefile and put this in it.
require 'rake/testtask'
task :default do
ENV['RACK_ENV'] = 'test'
Rake::Task['test'].invoke
end
Rake::Test...
Written by Sean Behan on 08/22/2013
The survey for people who make websites
I took the survey!
Click here to take it →
Written by Sean Behan on 06/17/2012