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
# encoding: utf-8 | |
class PhotoUploader < CarrierWave::Uploader::Base | |
# Include RMagick or MiniMagick support: | |
include CarrierWave::RMagick | |
# include CarrierWave::MiniMagick | |
# Include the Sprockets helpers for Rails 3.1+ asset pipeline compatibility: | |
# include Sprockets::Helpers::RailsHelper |
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
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'rspec/autorun' | |
require 'capybara/rspec' | |
require 'database_cleaner' | |
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | |
RSpec.configure do |config| | |
config.before(:suite) do |
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
***RSPEC*** | |
Equivalence | |
actual.should eq(expected) # passes if actual == expected | |
actual.should == expected # passes if actual == expected | |
actual.should eql(expected) # passes if actual.eql?(expected) | |
Identity | |
actual.should be(expected) # passes if actual.equal?(expected) | |
actual.should equal(expected) # passes if actual.equal?(expected) |
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
http://xavura.github.com/CoffeeScript-Sublime-Plugin/ |
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
\curl -L https://get.rvm.io | bash -s stable | |
rvm requirements | |
brew update | |
brew tap homebrew/dupes | |
brew upgrade | |
# can omit apple-gcc42 if xode and command line tools are installed | |
brew install autoconf automake apple-gcc42 libtool pkg-config openssl readline libyaml sqlite libxml2 libxslt libksba |
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
ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base, :access_key_id => ENV['AWSKEY'], :secret_access_key => ENV['AWSSEC'] |
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.configuration.stripe = { | |
:publishable_key => ENV['STRIPE_PUB'], | |
:secret_key => ENV['STRIPE_SEC'] | |
} | |
Stripe.api_key = Rails.configuration.stripe[:secret_key] |
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
%script{:src => "https://checkout.stripe.com/v2/checkout.js", | |
:class => "stripe-button", | |
:'data-label' => product.name, | |
:'data-amount' => product.cost * 100, | |
:'data-key' => Rails.configuration.stripe[:publishable_key]} | |
= form_tag purchase_product_path(product), :remote => true do end |
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
JSON.parse(string) | |
xhr = new XMLHttpRequest() | |
xhr.open('GET', 'URL', is_async) | |
xhr.responseType = 'arraybuffer'; // binary data | |
xhr.onload(fn) | |
xhr.send() |
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
// Settings in here override those in "Default/Preferences.sublime-settings", | |
// and are overridden in turn by file type specific settings. | |
{ | |
"font_face": "Source Code Pro Light", | |
"font_size": 13, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"trim_trailing_white_space_on_save": true, | |
"save_on_focus_lost": true | |
} |