#programming
15 posts tagged programming. Clear filter
-
Gem Information with Gem List
If you want to get version information about a gem the easiest way to do it is with this command For example will output the activemerchant versions I have installed. You can pass only part of the...
-
Fixing MySQL for Rails 2.2 Development on Mac OS X
Oh what trouble Rails 2.2 and MySQL (on Mac OS X) can be. Rails, as of version \= 2.2, no longer comes bundled with the MySQL adapter. This means you'll need to install it yourself, but it appears...
-
Installing Sphinx Search Engine on Mac OS X... or ld: library not found for -lmysqlclient
If you are trying to install Sphinx on Mac OS X, it will most likely fail. The current version of MySQL bundled with Mac OS X is not supported and therefore, it will spit out the error message...
-
Protect a Directory with Apache, .htaccess and httpasswd
Apache comes with a command line utility called "htpasswd". This utility will generate a username and password that you can use to authenticate against using a .htaccess file. Just run the utility...
-
Dot htaccess file for wordpress installation (.htaccess)
Login to your wordpress installation and scroll to and click the second to last link set "Settings". You'll need to configure wordpress to handle your new links as "permalinks". Make a selection...
-
Sending eMail with Rails on Mac OS X Development Environment
You'll need a mail transport agent (MTA). I installed and used postfix using Mac Ports. You'll need to start postfix, to send mail from your Rails application. You can set it as a startup item and...
-
Quick Syntax to Pipe an SQL Query Directly to a file
Here is a quick way to put the contents of a database table into a simple text file. This could be handy if for example, you just want to grab some emails and pop the results into a simple csv...
-
Rails Prototype JS and TinyMCE Autosave
TinyMCE is a nice little WYSIWYG for text processing online. It uses iFrames and Javascript callbacks to manipulate textarea form fields. Using it with Rails can be somewhat problematic if you want...
-
Using jQuery and Prototype Javascript Together with jQuery.noConflict();
To use the jQuery javascript framework in a Rails application, that also uses the Prototype framework for the same application, you'll need to reassign the $() function for jQuery to another...
-
Set Cron Job to Run Every Five Minutes for a Ruby on Rails Rake Task
First off you'll need to edit your cron file. Normally, the cron files are kept under /etc/cron.daily or /etc/cron.hourly but we can just use the command line tool, crontab and pass it the -e flag,...
-
YouTube Internal Server Error
Thought I'd share a snapshot of this error message from youtube.com. It's nice to know that their monkeys are highly trained. I figured they just got those lazy monkeys who work for bananas. 500...
-
Wildcard VirtualHost with Apache2
Set your ServerAlias directive to \.domain.tld - Here is a quick example. Now everything.example.com and anything.example.com, even though you didn't explicitly set them, will map to the...
-
Ruby strftime() method arguments
Just for reference strftime() arguments in ruby. Usage Time.now.strftime("%B/%d/%Y") %a weekday name. %A weekday name (full). %b month name. %B month name (full). %c date and time (locale) %d day...
-
Using Prototype to Access Form Data
Prototype has a powerful API for accessing and manipulating the Document Object Model, A.K.A the DOM. The following code will let you interact with a simple web form. Suppose we have a form that...
-
Parse for Links with Prototype JS
Parsing for links with the Prototype javascript library is easy. Here is the pattern for finding links And to implement it you can loop through your containers that might contain links