Writing
Notes on building software — the decisions that age well, the ones that don't, and what I learn in between.
-
The Best Video About How to Make Money Online
This is one of my favorite videos on the internet. It is what got me interested in Rails and made me work toward the goal of running my own business and hopefully soon, launch my own products....
-
Installing Ruby with RVM without Xcode using CLANG
I am not using the full Xcode package on my laptop. Instead I'm using the command line tools, offered by Apple as a separate and much smaller install. I haven't had too many issues, aside from not...
-
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...
-
How To Add A Route With A Forward Slash in Params with Rails 3 Application
Use an asterisk in the pattern to match for everything after it. In the example below, date will be available in the params hash as params[:date].
-
How to Add Additional Sub Directories to the Default Rails Test:Unit File Structure
Edit Rakefile in project root Add a new rake test task... E.g., rake test:lib, below everything else in that file... Alternatively, add a task in lib/tasks/ directory and plop in the same code...
-
How to Create a Date Time Snippet in Sublime Text 2 (Dynamic Signature with Time Stamp)
You'll have to create a new plugin. From the menu bar select Tools New Plugin Copy the Python script from the signature.py file. Remember to replace your email address (it's example.com). Save the...
-
Transform Matching Text with Gsub in Ruby and Regular Expression
Here is a gist that demonstrates how easy it is to transform text using gsub and a block with Ruby. "Scs Epc Score".gsub (/scs|epc/i) { |i| i.upcase } =\ SCS EPC Score For more helpful string...
-
Color Output with Test:Unit, AutoTest and Ruby 1.9
If you are testing using Test:Unit (rather than RSpec) and you're using Ruby 1.9. colorized output of your tests using Autotest will not be immediately available. Since, 1.9 comes with mini test...
-
How to Merge a YAML File Into a Single Hash in Ruby
require 'yaml' Nested YAML structure from something-nested.yml nested: key: value keytwo: valuetwo Procedural Approach to building a single Hash from nested YAML data structure. @yaml =...
-
Class
See the full pastie here: http://pastie.org/2580020
-
Changing GitHub Issue State in Git Commit Message
Changing issue state in git commit message for Github issues Example
-
Email Regex
Regular Expression that Matches Email Addresses:
-
Vim Tips and Tricks
The following tips and tricks can be put into your .vimrc file Remap jj to esc Quickly leave edit mode and back to visual mode with jj. This is probably the fastest key combination possible and one...
-
How to Upgrade RVM on Mac OS X
I had an old version of rvm installed and wanted to upgrade. So old in fact that the resource for upgrading no longer existed. just returned a 301, redirect. Luckily, the following worked
-
Ruby Reload! Method in Non Rails IRB Sessions
I love the Rails reload! function when in the console. I need it in Irb. To get it back this is what I did. If you don't already have an .irbrc file in your home directory, just create it. Add this...