Skip to content

Instantly share code, notes, and snippets.

View williamn's full-sized avatar

William williamn

  • Jakarta, Indonesia
View GitHub Profile
@williamn
williamn / Rails CMS alternatives
Created January 29, 2010 07:28
Rails CMS alternatives
Rails CMS alternatives
======================
Note: project activity was checked on 11/26/09.
Active projects:
----------------
Railsyard
site: http://www.railsyardcms.org/
Last update: 02/07/12
repo: https://github.com/cantierecreativo/railsyardcms
@williamn
williamn / svn_ignore.sh
Created May 24, 2010 10:11
Rails svn ignores
#!/bin/sh
svn remove log/*
svn commit -m 'Removing log files'
svn propset svn:ignore "*.log" log/
svn update log/
svn commit -m 'Ignoring all files in /log/ ending in .log'
svn move config/database.yml config/database.example
svn commit -m 'Moving database.yml to database.example to provide a template for anyone who checks out the code'
svn propset svn:ignore "database.yml" config/
svn update config/
@williamn
williamn / rcov.rake
Created June 8, 2010 10:25
Shoulda and rcov the right way
#
# Original blog here http://honoluluhacker.com/2009/11/19/install-shoulda-and-rcov-the-right-way/
# Update your test/test_helper.rb, add
# require 'shoulda/rails'
#
require File.expand_path(File.dirname(__FILE__) + "/../../config/boot")
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
@williamn
williamn / Rakefile
Created September 6, 2010 07:32
Rakefile (shoulda + rcov)
## add this to test/test_helper.rb
require 'shoulda/rails'
## add this to Rakefile
require 'shoulda/tasks'
namespace :test do
desc 'Measures test coverage'
task :coverage do
rm_f "coverage"
rm_f "coverage.data"
@williamn
williamn / link_dump.rb
Created October 5, 2010 05:33
Dump your delicious.com posts
@williamn
williamn / .gitignore
Created October 7, 2010 04:50
Rails .gitignore
*.log
database.yml
tmp/
@williamn
williamn / backup.rake
Created October 7, 2010 15:39
Easy migration between databases
#
# Original blog here http://bit.ly/5AutLA
#
namespace :db do
namespace :backup do
def tables
ActiveRecord::Base.connection.tables.sort.reject do |tbl|
['schema_migrations'].include?(tbl)
@williamn
williamn / svnadmin_load.sh
Created October 13, 2010 02:43
How to fix: svnadmin: Dump stream contains a malformed header (with no ':') at '* Dumped revision 0.'
# If you happen to have this problem when loading your SVN dump
# svnadmin: Dump stream contains a malformed header (with no ':') at '* Dumped revision 0.'
grep --binary-files=text -v '^* Dumped revision' ./repository.dump > ./repository.clear-dump
svnadmin load /new/path/to/your/repository < ./repository.clear-dump
@williamn
williamn / Kambing.repo
Created October 26, 2010 09:31
CentOS 5 yum repo file
[kambing-base]
name=CentOS $releasever - Base
baseurl=http://kambing.ui.ac.id/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://kambing.ui.ac.id/centos/RPM-GPG-KEY-CentOS-5
[kambing-addons]
name=CentOS $releasever - Addons
require 'rcov/rcovtask'
namespace :test do
namespace :coverage do
desc "Delete aggregate coverage data."
task(:clean) { rm_f "coverage.data" }
end
desc 'Aggregate code coverage for unit, functional and integration tests'
task :coverage => "test:coverage:clean"
%w[unit functional integration].each do |target|