Skip to content

Instantly share code, notes, and snippets.

@metamn
metamn / auth_form_user.html.haml
Created May 19, 2009 18:33
_Form User for Authlogic
= form.label :login
%br
= form.text_field :login
%br
%br
= form.label :email
%br
= form.text_field :email
%br
%br
@metamn
metamn / auth_new_user.html.haml
Created May 19, 2009 18:34
New User for Authlogic
= content_for :content do
%h1 Register
- form_for @user, :url => account_path do |f|
= f.error_messages
= render :partial => "form", :object => f
= f.submit "Register"
@metamn
metamn / auth_user_show.html.haml
Created May 19, 2009 18:35
Show User for Authlogic
= content_for :content do
%p
%b Login
=h @user.login
%p
%b Login count
=h @user.login_count
@metamn
metamn / _header.haml
Created May 20, 2009 13:56
Header partial for the Application template
#logo.span-2
%h1
= link_to "Application Name", root_path
#login.last.prepend-22
= render :partial => "shared/login"
.clear
@metamn
metamn / _login_header.haml
Created May 20, 2009 13:57
Login partial for the App Template
Logged in:
= pluralize User.logged_in.count, "user"
%br
- if !current_user
= link_to "Register", new_account_path
|
= link_to "Log In", login_path
- else
= link_to "My Account", account_path
|
@metamn
metamn / code_quality_template.rb
Created May 20, 2009 16:17
metric_fu application template
# metric_fu based code analysis
if yes?("Load the Basic Rails template?")
run "wget http://gist.github.com/114140.txt"
run "mv 114140.txt base_template.rb"
load_template "base_template.rb"
end
if yes?("(Re)Install metric_fu? (with roodi, flay, flog, reek, ...) ")
run "sudo gem install jscruggs-metric_fu"
git :init
file ".gitignore", <<-END
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
END
script/generate mailer mailer
config/environments/development.rb
ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.sendmail_settings = {
:location => '/usr/sbin/sendmail',
:arguments => '-i -t' }
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "iso-8859-1"
@metamn
metamn / compass haml
Created August 29, 2009 13:59
compass haml
!!!
%html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en"}
%head
= stylesheet_link_tag 'screen.css', :media => 'screen, projection'
= stylesheet_link_tag 'print.css', :media => 'print'
/[if IE]
= stylesheet_link_tag 'ie.css', :media => 'screen, projection'
= stylesheet_link_tag 'application', :media => 'screen, projection'
%body
.container.showgrid
@metamn
metamn / compass sass
Created August 29, 2009 13:59
compass sass
@import screen.sass
-# Theme
-# =====================================================
body
:background red