Code snippets including custom code releases and modified GPL code to resolve issues or provide functionality.
I was working on my personal blog and wanted to add the date or a date range to the top of each gallery when they are listed out. The blog I am speaking of uses WordPress, WP version 2.7, with the NextGen Gallery plugin, NGG version 1.2.1, for pictures. I list the all of the…
I am starting to learn ruby and am working on a test script to import some data into a MySQL database. I am using the below code found on kitebird.com to first get the MySQL connection from Ruby working. The code was producing an error which I figured might be because I installed the MySQL Ruby…
ruby #check for column ActiveRecord::Base.connection.tables.include?(name) #check for table Model.columns_hash.has_key("column_name")?
There are several utilities out there to check the current health of your Macbook and Macbook Pro batteries. However none of them seem to automatically store historical data. The script below can be used to create a historical log of your battery’s health.
Here’s a “hierarchal summary” of The Rails startup process from a paragliders perspective – artweb design. By hierarchal, I mean its organized by how the code is executed. By summary, I mean things that I was interested in. Rais app starts by running environment.rb boot.rb is required (require File.join(File.dirname(__FILE__), ‘boot’)) Defines RAILS_ROOT constant (points to…
If you want to export a subset of data (rather than the entire database or table) in CSV format: Export subset of data with PgAdmin Click “Execute Arbitrary SQL queries” button Type query that will generate the subset of data eg. select * from users where id >= 433 and id <= 436; Click “Execute…
Installs Rails 2.2 and Rubygems 1.3.1 to a new Rails app in a git repo. Rubygems 1.3.1 is necessary for Rails 2.2.2 bash #get the version of Ruby gems, need 1.3.1 gem -v #install a gem to update rubygems # don’t do gem update –system gem install rubygems-update #to actually update the rubygems…
I imported an old Blogger account into a WordPress blog recently and my titles did not import correctly. So there I was stuck with 500 posts with no titles. I decided the easiest way to fix that would be to copy the post dates from the Blogger account to the titles in WordPress. So here is…
I am by no means a CSS guru but I definitely have to do my fair share. Last night I was struggling with creating a three column grid with multiple rows inside of another div. Everything I was trying ended up blowing out of the sides of the original div or no matter what I…