This file contains hidden or 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
| ;;; Ruby/Rails development | |
| ;; RVM support | |
| ;; Ruby Version Manager | |
| (require 'rvm) | |
| (rvm-use-default) | |
| ;; automatically add 'end' after class, module, def etc. | |
| ;; automatically pair braces, single and double quotes | |
| (require 'ruby-electric) |
This file contains hidden or 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
| Factory.define :item do |f| | |
| include ActionDispatch::TestProcess | |
| f.name "Macbook Pro 15" | |
| f.price_in_dollars 1500 | |
| f.photo fixture_file_upload('/files/avatar.jpg', 'image/jpg') | |
| end |
This file contains hidden or 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
| ~$ ARCHFLAGS='-arch i386 -arch x86_64' | |
| ~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes | |
| ~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download | |
| ~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0 | |
| ~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes | |
| ~/RubyCocoa-1.0.0$ ruby install.rb setup | |
| ~/RubyCocoa-1.0.0$ sudo ruby install.rb install |
This file contains hidden or 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
| module Rack | |
| class NoIE | |
| def initialize(app, options = {}) | |
| @app = app | |
| @options = options | |
| @options[:redirect] ||= 'http://www.microsoft.com/windows/internet-explorer/default.aspx' | |
| @options[:minimum] ||= 7.0 | |
| end | |
| def call(env) |
This file contains hidden or 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
| # Copy and paste this to the rails console to test your email settings | |
| class MyMailer < ActionMailer::Base | |
| def test_email | |
| @recipients = "[email protected]" | |
| @from = "[email protected]" | |
| @subject = "test from the Rails Console" | |
| @body = "This is a test email" | |
| end | |
| end |
NewerOlder