Caius Durling
-
2008-11-06 13:03:02
When I create a new rails app, I'm constantly going back to another project and stealing the .gitignore file from it to make sure that git doesn't know about certain files rails either updates frequently, or stores machine-specific data in. The latter is generally just config/database.yml, because I develop alongside my colleagues at Brightbox and we deploy via capistrano, we always put the database.yml file in the shared directory on the server, so we each have our own version with our local credentials in it locally. And thus we don't want it to be tracked by git.
Here's what I've collated from various sources over the few weeks I've been using git + rails everyday.
.gitignore
config/database.yml
log/*.log
tmp/*
# OS X only
.DS_Store
**/.DS_Store
Then to make sure log/ and tmp/ are tracked, I just add a blank .gitignore file in them.
touch log/.gitignore
touch tmp/.gitignore
Caius Durling
-
2008-11-03 11:40:04
So for work I have to subscribe to a shared google calendar the company uses. Annoyingly this can't be through my Google Apps account though, it has to be through my normal google account.
Also annoying is the fact google doesn't let me subscribe to my shared calendars without making them 100% public. Which means the shared private calendar work uses would have to be a public shared calendar, which is obviously not going to happen. (Can't have everyone knowing when the secret drinking parties are!)
Thankfully, there is already a solution out there to this problem, and it comes in the form of a Preference Pane called SpanningSync that syncs iCal to Google Calendar. All you need to do is install the prefpane and enter your google email/password (which is then safely secured in your keychain I believe.)
What it does is stick an icon in the menubar, and then at a pre-defined (and customisable) interval, sync any new changes between the local iCal calendar and the remote shared calendar in your google acccount.
Spanning Sync is only $25 to register for the year, but you can save yourself $5 by entering 6EMQAC as the spanning sync coupon code, or clicking here
Caius Durling
-
2008-11-03 06:48:27
When I create a rails app from scratch I like to include certain plugins to help me write the app, such as the Rspec testing framework instead of the built-in Test::Unit and jQuery instead of prototype.
And here are the commands in the order I run them to create the blank app.
# Create the rails app
cd ~/Sites/apps/
rails myapp
cd myapp
# Setup a git repo
git init
# Add all files and make the initial import
git add .
git commit -m "Initial Import"
# Add the plugins as git submodules
git submodule add git://github.com/dchelimsky/rspec.git vendor/plugins/rspec
git submodule add git://github.com/rahoulb/rspec-rails.git vendor/plugins/rspec-rails
git submodule add git://github.com/aslakhellesoy/cucumber.git vendor/plugins/cucumber
git submodule add git://github.com/brynary/webrat.git vendor/plugins/webrat
git submodule add git://github.com/caius/demeters_revenge.git vendor/plugins/demeters_revenge
# Commit the changes
git ci -am "Adding all needed submodules"
# Replace TestUnit with rspec
git rm -r test/
ruby script/generate rspec
# Replace stories with cucumber features
rm -rf stories/
ruby script/generate cucumber
# Add the changes to git
git add .
git ci -m "Committing initial rspec/cucumber files"
# Install jRails, we have to install it using script/plugin
# Remove existing javascript files
git rm public/javascripts/*
mkdir public/javascripts
# Add jrails
ruby script/plugin install http://ennerchi.googlecode.com/svn/trunk/plugins/jrails
git add vendor/plugins/jrails/ public/javascripts
git ci -m "Adding jRails to replace Prototype"
And now you have a blank app waiting for you to write using features for full stack testing, and rspec for testing model and controller code.
Updated 2008-11-04
Added demeters revenge and jRails plugins.
Update 2008-11-05
I've also blogged the .gitignore file I use with rails apps as well. Usually add it into my apps before running git init
Caius Durling
-
2008-10-14 13:59:01
Back in the day I swapped the keys on my 12" powerbook keyboard around to read macgenius across the middle row.

I unearthed the picture, and figured, why not do it to my apple aluminium keyboard? So I found a tutorial from some other guy that'd done it, and dug out my penknife.

After that I decided to rearrange the macbook internal keyboard as well. First I googled around to make sure lifting the keys was the same as doing it on the external keyboard (which it appeared to be), then I went ahead and rearranged them as well.

So whilst I was wondering what to do about it, my mother emailed me and suggested using ontherails instead of macgenius. So I did, and now the top row reads ontherails on the macbooks' internal keyboard.

All pictures are licenced under Creative Commons Attribution 2.0 Generic licence and the above pictures, plus some in progress shots, are available in my Keyboard Modifications flickr set.