Skip to content

Instantly share code, notes, and snippets.

# app name
app_name = @root.split('/').last
if yes?("Drop databases?")
run "mysqladmin -u root -p drop #{app_name}_development -f"
run "mysqladmin -u root -p drop #{app_name}_test -f"
run "mysqladmin -u root -p drop #{app_name}_production -f"
end
if yes?("Create databases?")
run "gem sources -a http://gems.github.com"
gem 'desert', :version => '0.5', :lib => 'desert'
gem 'mislav-will_paginate', :version => '~> 2.3.6', :lib => 'will_paginate', :source => 'http://gems.github.com'
gem 'tog-tog', :version => '0.4.4', :lib => 'tog'
rake "gems:install"
plugin 'acts_as_commentable', :svn => "http://juixe.com/svn/acts_as_commentable"
file "db/migrate/" + Time.now.strftime("%Y%m%d%H%M%S") + "_acts_as_commentable.rb",
%q{class ActsAsCommentable < ActiveRecord::Migration
#!/usr/bin/env ruby
# Written by Kieran P
# http://github.com/KieranP
# http://twitter.com/k776
# http://k776.tumblr.com
#
# Feel free to fork and modify.
# If you do, send me a message on
# Github details changes and I'll
@iampersistent
iampersistent / blogger.feature
Created November 1, 2010 06:32
example gherkin user story for a blogger
Feature: Blogger
In order to communicate my thoughts
As a blogger
I want to enter material and publish it
Scenario: Create a Blog Account
Given I have an account
When I submit my subdomain
And I select a name
Then I should own a blog account
@iampersistent
iampersistent / blogReader.feature
Created November 1, 2010 06:41
example gherkin user story for a blog reader
Feature: Blog Reader
In order to learn what another person is thinking
As a blog reader
I want to find and read blog entries
Scenario: Find Text Blog Entry
Given I am on a bloggers page
Then I should see a list of blog entries titles
And I should see the first 100 characters of each entry's content
And I should have a link to each entry
@iampersistent
iampersistent / gist:762021
Created January 1, 2011 21:30
Mapping Configuration
doctrine.orm:
mappings:
AdjectiveBundle: ~
ArtistBundle: ~
CDBundle: ~
ComposerBundle: ~
TrackBundle: ~
SonicUserBundle: ~
UserBundle: ~
default_entity_manager: default
@iampersistent
iampersistent / gist:762028
Created January 1, 2011 21:39
working config
doctrine.orm:
default_entity_manager: default
entity_managers:
default:
connection: default
mappings:
AdjectiveBundle: ~
ArtistBundle: ~
CDBundle: ~
ComposerBundle: ~
# app/config/security.yml
security.config:
providers:
fos_user:
password_encoder: &password_encoder
sha1
id: fos_user.user_manager
firewalls:
public:
pattern: .*
@iampersistent
iampersistent / gist:762161
Created January 2, 2011 00:50
mapping that works
doctrine.orm:
mappings:
AdjectiveBundle: ~
ArtistBundle: ~
CDBundle: ~
ComposerBundle: ~
TrackBundle: ~
SonicUserBundle: ~
UserBundle: ~
@iampersistent
iampersistent / gist:772693
Created January 10, 2011 12:08
security config
# app/config/security.yml
security.config:
providers:
fos_user:
id: fos_user.user_manager
firewalls:
public:
pattern: .*
form_login:
login_path: /login