Before you get started, I'm assuming you've got the following setup on your machine:
- Rails-3
- RVM
Run this to host refinery-0.9.7.13 on Heroku | |
# 1. Basic installation | |
rvm use 1.8.7-p174@refinery2 --create | |
gem install bundler | |
gem install refinerycms | |
# 2. Run refinerycms. Ensure postgres has started | |
refinerycms refineroku --database=postgresql |
module FakewebHelpers | |
# Make sure nothing gets out (IMPORTANT) | |
FakeWeb.allow_net_connect = false | |
# Turns a fixture file name into a full path | |
def fixture_file(filename) | |
return '' if filename == '' | |
File.expand_path(Rails.root.to_s + '/features/fixtures/' + filename) | |
end |
require "imgscalr-lib" # https://github.com/thebuzzmedia/imgscalr | |
require "jruby" | |
java_import "javax.imageio.ImageIO" | |
ImageIO.write( | |
com.thebuzzmedia.imgscalr.Scalr.resize( | |
ImageIO.read(java.io.File.new("iss.jpg")), | |
250), | |
"jpg", | |
java.io.File.new("iss_new.jpg")) |
#!/usr/bin/env ruby | |
require "net/http" | |
require "rexml/document" | |
class PicasawebDownloadClient | |
PICASAWEB = "picasaweb.google.com" | |
# Will return a list of links to every photo in an album |
var eol = {}; | |
// For more information on this organizational pattern, refer to James Yu's | |
// blog post titled "A Backbone.js Tutorial with Rails (Part 1)" referenced | |
// in the README. | |
var App = { | |
Views: {}, | |
Controllers: {}, | |
Collections: {}, | |
init: function() { |
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') | |
require 'active_record' | |
# The following initializer will load the necessary HStore modules with | |
# ActiveSupport.on_load(:active_record) in a Railtie | |
run_hstore_initializer | |
class Document < ActiveRecord::Base | |
end |
// Will include jquery. The newline matters. | |
//= require jquery |
project $ heroku db:pull | |
Loaded Taps v0.3.23 | |
Auto-detected local database: postgres://[email protected]/pg91-dev?encoding=utf8 | |
Warning: Data in the database 'postgres://[email protected]/pg91-dev?encoding=utf8' will be overwritten and will not be recoverable. | |
[snip] | |
project $ heroku pg:promote HEROKU_SHARED_POSTGRESQL_PURPLE | |
project $ heroku db:push |