This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%h1 Login | |
- form_for @user_session, :url => user_session_path do |f| | |
= f.error_messages | |
= f.label :login | |
%br | |
= f.text_field :login | |
%br | |
%br | |
= f.label :password | |
%br |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# template.rb | |
gem 'activemerchant', :lib => 'active_merchant' | |
gem 'sqlite3-ruby', :lib => 'sqlite3' | |
gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com' | |
plugin 'exception_notifier', :git => 'git://github.com/rails/exception_notification.git' | |
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git' | |
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git' | |
plugin 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import <Foundation/Foundation.h> | |
#import <AVFoundation/AVFoundation.h> | |
@interface Controller : NSObject /* Specify a superclass (eg: NSObject or NSView) */ { | |
IBOutlet UILabel *subtitle; | |
SystemSoundID soundID1; | |
SystemSoundID soundID2; | |
SystemSoundID soundID3; | |
SystemSoundID soundID4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "Controller.h" | |
#import <AVFoundation/AVFoundation.h> | |
@implementation Controller | |
-(void) awakeFromNib { | |
NSBundle *mainBundle = [NSBundle mainBundle]; | |
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:[mainBundle pathForResource:@"Foo.mp3" ofType:@"mp3"]], &soundID1); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file 'app/views/layouts/master.html.haml', <<-TEMPLATE | |
!!! Strict | |
%html{:xmlns => 'http://www.w3.org/1999/xhtml', 'xml:lang' => 'en'} | |
%head | |
%meta{'http-equiv' => 'Content-Type', :content => 'text/html; charset=UFT-8'} | |
= stylesheet_link_tag :all, :cache => true | |
= javascript_include_tag :all, :cache => true | |
= title | |
%body | |
#wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Use Vim settings, rather then Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
" allow backspacing over everything in insert mode | |
set backspace=indent,eol,start | |
set nobackup | |
set nowritebackup | |
set history=50 " keep 50 lines of command line history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sudo gem install pg | |
Building native extensions. This could take a while... | |
ERROR: Error installing pg: | |
ERROR: Failed to build gem native extension. | |
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb | |
checking for main() in -lpq... yes | |
checking for libpq-fe.h... yes | |
checking for libpq/libpq-fs.h... yes | |
checking for PQconnectionUsedPassword()... no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RAILS_ROOT/lib/tasks/seed.rake | |
begin | |
require 'highline/import' | |
rescue LoadError | |
puts 'HighLine required, please run rake setup first' | |
end | |
namespace :db do | |
desc "Setup Database" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
ROLES = %w(admin user guest).freeze | |
acts_as_authentic | |
acts_as_authorization_subject | |
validates_presence_of :login, :email | |
belongs_to :creator, :class_name => "User" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# db/fixtures/roles.rb | |
%w(admin normal guest).each do |r| | |
Role.seed(:name) do |s| | |
s.name = r | |
end | |
end | |
# db/fixtures/users.rb |
OlderNewer