Git for Rails
Last night I ran a presentation on using Git, and very briefly how to start a rails project in git for the Brisbane Ruby & Rails Brigade
Last night I ran a presentation on using Git, and very briefly how to start a rails project in git for the Brisbane Ruby & Rails Brigade
I use Sass (& Haml), where its an option for producing sites, as I like the ‘cleanliness’ of it. I have been missing being able to use the snippets of the TextMate CSS bundle, so I have ported them over to a Sass bundle, with the syntax from http://sporkmonger.com/2007/12/24/sass-textmate-bundle.
I have published it at http://github.com/aussiegeek/ruby-sass-tmbundle/tree/from-css-bundle
I’ve just migrated the server that runs my blog, and some internal apps to mod_rails.
It is extremely simple to deploy compared to apache+mongrel like I was using previously, and more memory effecient for the seldom used apps I keep on this server.
I was warned of some potential gotchas in regards to rewrite rules, but no issues here, altough I am only using rewrites to redirect feed requests to FeedBurner.
My config for this virtual host in all its gory detail:
Yes, thats all. Good work guys!
<VirtualHost *>
ServerName aussiegeek.net
DocumentRoot /srv/www/alanblog/current/public
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteRule ^/posts\.xml$ http://feeds.feedburner.com/alanharper [R=301,L]
I’ll be giving an intro to Haml & Sass at the Brisbane Ruby & Rails Brigage on monday night, if anybody is interested
I’ve hacked together a simple script for converting timezones from the local timezone to utc for Rails 2.1
#!env ruby
class DummyTable
def initialize(tablename)
@@tablename=tablename
end
def self.method_missing(m, *args); end
def self.datetime(name,options={})
puts "execute \"UPDATE #{@@tablename} SET #{name}=CONVERT_TZ(#{name},'SYSTEM','+00:00');\""
end
end
def create_table(tablename,options,*block)
dummy_table=DummyTable.new(tablename)
yield DummyTable
end
def add_index(name,fields,options={}); end
class ActiveRecord;end
class ActiveRecord::Schema
def self.define(options={}, *block)
yield
end
end
require 'db/schema.rb'
Drop this file in the root of your project and just run it with plain Ruby. I wrote it this way so I could avoid ActiveRecord, it will spit out a bunch of execute commands ready for plugging in to a migration
I’ve written a tiny module for Vlad to deploy to Passenger (mod_rails). It’s available from http://github.com/aussiegeek/vlad
To use it, just update your Rakefile where Vlad.load is called, and update it like so:
Vlad.load :app => 'phusion'
Lately, I have been trialing replacements for the ExceptionNotifier plugins, as getting spammed to death when something breaks is just not fun at all!
First of all at work, I have been running using Hoptoad, from Thoughtbot, which has been running fine