Writing
Notes on building software — the decisions that age well, the ones that don't, and what I learn in between.
-
How to Copy and Paste to/from the Global Register with Tmux on Mac OS X
Using the system clipboard with tmux on OS X is broken. I really like tmux but having copy and paste is kind of important for me. Here is my attempt to get it back with a simple bash script until I...
-
Reusing Scopes (Formerly Named_scope) In Rails 3
You can easily chain scopes together in your models. class Article < ActiveRecord::Base scope :ordered, order('position ASC') scope :published, ordered.where('published = ?', true) scope...
-
Installing MatPlotLib on OS X for Python Version 2.6.1 with PIP and VirtualEnv
If you thought you had installed matplotlib only to find this File "/Library/Python/2.6/site-packages/matplotlib-0.91.1-py2.6-macosx-10.6-universal.egg/matplotlib/numerix/ init.py", line 166, in...
-
Installing Ruby on Rails 3, MySQL, Git, Ruby Enterprise Edition, Passenger (Mod_Rails) on Ubuntu with Rackspace Cloud.
Short and sweet. Here all the commands I run in this order to set up a brand new box. It usually takes about 10 - 15 minutes on a 256 MB RAM instance. Compiling Ruby Enterprise Edition, which is...
-
Rails 3 disable_with Does Not Work with Ajax Remote Form_for
It appears that the :disable\with option on the submit\tag form helper method does not behave as expected with remote forms. I'm not sure if this is a bug or not. But the fix is pretty straight...
-
Execute Javascript When Using Link_to_function To Include a Partial in Rails
If you use the link\to\function to replace content in a div with content from a partial, any javascript that you include in the partial will not be executed. It is instead included, but will do...
-
Rails Select Tag and Onchange Event Calling a Remote Function with Default Option Selected
Here is a little code snippet that will fire off a request to update\client\path when you change the select field. This stands alone, rather than being apart of a larger form. The Client::CATEGORY...
-
Ruby Enterprise Edition and Passenger ./script/console production fails and instead returns Loading production environment (Rails 2.3.5) Rails requires RubyGems >= 1.3.2. Please install RubyGems...
After installing Ruby Enterprise Edition, REE, and Passenger on Ubuntu you may see this error message when you run script/console for the first time You then scratch your head and run to find that...
-
How Many Gigs of RAM Are On My Server?
How much memory is on my linux server? Run the free command Which will tell you memory in Gigs. You can pass other flags, such as, -m or -k, which will give you the number in megs and kilobytes...
-
Have Git Email Committers After Pushes
You need a Mail Transfer Agent MTA on the server. The easiest way is to install Sendmail, which Git uses by default. Remember that /etc/hosts file needs the ip address to map to the domain name...
-
Setting Up Users, Permissions and Groups for SSH Access to a Shared Git Repository
If you are having permission problems using git, such as There are a couple thing you can do to remedy the situation, before moving to a full on git server like gitosis. Create your users and add...
-
Installing and Using Rvm on Mac OS X, Creating Gemsets and Reverting to Original Environment
What is RVM and why should you use it? RVM is a Ruby interpreter, version management tool. In short, it enables you to switch between different versions and releases of Ruby (for instance, version...
-
Renaming Routes in Rails 3 with :As and :Controller
Renaming routes in Rails 2.\ is straight forward. It goes something like this. This will give you users\path and form\for(User.new) helpers, for instance, mapping the url to /members instead of...
-
Combat Spam with the Akismet Class for Ruby
Here is the Akismet.rb class, written by David Czarnecki. I've seen several tutorials online using this class, however, the class isn't available at David's blog. So... I reposted it here and at...
-
Running Gem Server to View Docs for Ruby Libraries on Localhost
will boot up documentation on port 8808 by default pass it the -p flag followed by the port number to change.