rubycoloredglasses


I'm Jason, a web application developer in East Tennessee.


  1. Rake Tasks

    If you’re wanting to know which Rake tasks are available for you to use from the command line, simply use the ‘rake -T’ command:

    $ rake -T
    (in /Users/jason/railsproject)
    rake db:abort_if_pending_migrations       # Raises an error if there are pending migrations
    rake db:charset                           # Retrieves the charset for the current environment's database
    rake db:collation                         # Retrieves the collation for the current environment's database
    rake db:create                            # Create the database defined in config/database.yml for the current RAILS_ENV
    rake db:create:all                        # Create all the local databases defined in config/database.yml
    rake db:drop                              # Drops the database for the current RAILS_ENV
    rake db:drop:all                          # Drops all the local databases defined in config/database.yml
    

    A really useful one is the ‘routes’ option which outputs a list of the routes configured.

    macbook:railsproject jason$ rake routes
    (in /Users/jason/railsproject)
      /:controller/:action/:id
      /:controller/:action/:id(.:format)
    

  2. MySQL Gem Installation on Mac 10.5.8 - 64 bit??

    I’m setting up a new Ruby on Rails application, and tried to run the first migration for the creation of the new database. This failed because I didn’t have the MySQL gem installed. I’m using a 64 bit processor (Intel Core 2 Duo) so I installed the 64 bit MySQL for 10.5.8 (Leopard, I haven’t upgraded to Snow Leopard yet).

    When trying to run the installation command I received an error:

    $ sudo gem install mysql
    Password:
    Building native extensions.  This could take a while...
    ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.
    /opt/local/bin/ruby extconf.rb
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lm... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lz... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lsocket... no
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lnsl... no
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lmygcc... no
    checking for mysql_query() in -lmysqlclient... no
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers.  Check the mkmf.log file for more
    details.  You may need configuration options.
    

  3. Wordpress Plugin - Custom Pages?

    My Dilema

    Okay. I’ve worked on making a Wordpress plugin once. It’s pretty easy to make a plugin which replaces a tag such as [another-plugin-tag parameter="value"] with some sort of other HTML code. For instance it’s pretty straight forward to replace [iframe http://www.google.com/ 800 600] with an iframe tag.

    Something I’ve found difficult to find however is how you can create custom pages as soon as the plugin is activated, which are accessible using a permalink such as http://www.wordpress-site.com/myplugin/search/ which can submit a form to another URL such as http://www.wordpress-site.com/myplugin/results/ and then provide the results with a URL such as http://www.wordpress-site.com/myplugin/results/id/3/ or anything else pretty like that.


  4. Ubuntu 9.10 Karmic Koala - VNC resolution limited without monitor

    Update 04/23/2010 - I’m not finding a solution to this issue. Sorry. I’ve lost interest.

    I recently setup Ubuntu 9.10 on a desktop system, so I could use it as a file server. I’m was able to enable the remote desktop feature for it, which is basically a VNC server.

    The issue is that once I disconnected a monitor from the computer and set it up next to my router (plugged directly in), and restarted it, VNC would only work with a maximum resolution of 640x480.


  5. PHP Not Parsing on Debian / Ubuntu server with Apache2

    My friend Marshall was recently having issues getting PHP5 installed and working on his Ubuntu server, which is a Debian based distribution.

    We updated all the packages involved…Apache2, php5, libapache2-mod-php5, made sure the module was installed, restarted Apache2, etc. Nothing worked.

    It turns out that the default php5.conf configuration for Debian / Ubuntu’s packages are using an incorrect syntax. Edit /etc/apache2/mods-available/php5 conf to reflect:


  6. Dell Dimension 3000 - Audio is Choppy

    At work I have a Dell Dimension 3000 workstation, and for months I’ve put up with the computer being kind of slow. I just figured it was due to the computer being kind of old…but I brought in some headphones so I could do some serious music listening while I work and just got fed up with the way the sound was choppy. Anytime I’d do anything processor intensive the music I was listening to in Grooveshark (which I highly recommend you check out) would sound like crap.

    So I installed the latest sound driver from Dell.com for the integrated sound card and still after rebooting it sucked. Also when I start the computer up in the morning, I would have to wait like 3 minutes at least for all the startup programs to load. Nothing else would open until this was done.


  7. Un-Hide Someone in Facebook

    My aunt recently asked me how to un-hide someone from the news feed for her Facebook account.

    Facebook hide news feed

    Like many other people before her, she’s pressed the ‘Hide’ button for someone, then realized it was a mistake…but couldn’t find out how to unhide them.

    To add someone back to your Facebook news feed, simply scroll to the bottom of the page and click on the ‘Edit Options’ link for your news feed.


  8. Selenium - no display specified

    I’m not very experienced with X-windows on the Linux platform, so I’m not too skilled in troubleshooting issues with the display. I recently upgraded an Ubuntu system at work to use Ubuntu 9.04 (Jaunty Jackalope), which only has Firefox 3 available (no package for Firefox 2). I had a Selenium server setup running tests, but they stopped working after I upgraded to this newer version of Ubuntu.

    I thought that perhaps Selenium wasn’t compatible with version 3 of Firefox, but this isn’t the case. The Selenium website says ‘Firefox 2+’ for browsers running on Linux.


  9. Common Computer Mistakes

    Whether you are an individual, or a startup business, you’ll more than likely have a website or a computer. I’ve had my fair share of experiences with personal computers (PCs and Macs), and I’ve also worked at a website hosting company, HostDime.

    I’ve often cringed due to the negligence of individuals and/or companies regarding the following items. Here are some tips to save you from large losses.


  10. Rounded Corners

    One of the most popular Web 2.0 practices is rounded corners. How do you get them without uploading images, and nesting DIV’s, and worrying about other complications that can break your precious rounded corners?

    Answer! jQuery Corners

    jQuery Corners is compatible with Firefox, Internet Explorer 6+, Safari (including iPhone), Google Chrome, and Opera 9.0.