https://devcenter.heroku.com/articles/custom-domains http://thenomadicfreelancer.blogspot.com/2012/08/pointing-godaddy-domain-to-your-heroku.html
For each custom subdomain use domains:add
in the Terminal.
# PostgreSQL. Versions 7.4 and 8.x are supported. | |
# | |
# Install the pg driver: | |
# gem install pg | |
# On Mac OS X with macports: | |
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config | |
# On Windows: | |
# gem install pg | |
# Choose the win32 build. | |
# Install PostgreSQL and put its /bin directory on your path. |
# SQLite version 3.x | |
# gem install sqlite3 | |
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
pool: 5 | |
timeout: 5000 | |
# Warning: The database defined as "test" will be erased and | |
# re-generated from your development database when you run "rake". |
# /config/initializers/sidekiq.rb | |
current_web_concurrency = Proc.new do | |
web_concurrency = ENV['WEB_CONCURRENCY'] | |
web_concurrency ||= Puma.respond_to? | |
(:cli_config) && Puma.cli_config.options.fetch(:max_threads) | |
web_concurrency || 16 | |
end | |
local_redis_url = Proc.new do |
def random_location_from(center_lat, center_lng, distance) | |
radius = distance | |
radiusInDegrees=radius/111000.to_f | |
r = radiusInDegrees | |
origin_x = center_lat | |
origin_y = center_lng | |
u = rand(0.00..1.00) | |
v = rand(0.00..1.00) |
https://devcenter.heroku.com/articles/custom-domains http://thenomadicfreelancer.blogspot.com/2012/08/pointing-godaddy-domain-to-your-heroku.html
For each custom subdomain use domains:add
in the Terminal.
# /config/initializers/sidekiq.rb | |
current_web_concurrency = Proc.new do | |
web_concurrency = ENV['WEB_CONCURRENCY'] | |
web_concurrency ||= Puma.respond_to? | |
(:cli_config) && Puma.cli_config.options.fetch(:max_threads) | |
web_concurrency || 16 | |
end | |
local_redis_url = Proc.new do |
['all', Rails.env].each do |seed| | |
seed_file = "#{Rails.root}/db/seeds/#{seed}.rb" | |
if File.exists?(seed_file) | |
puts "*** Loading #{seed} seed data" | |
require seed_file | |
end | |
end |
# POST /pictures | |
# POST /pictures.json | |
def create | |
#check if file is within picture_path | |
if params[:picture][:picture_path]["file"] | |
picture_path_params = params[:picture][:picture_path] | |
#create a new tempfile named fileupload | |
tempfile = Tempfile.new("fileupload") | |
tempfile.binmode |
class ImageUploader < CarrierWave::Uploader::Base | |
class FilelessIO < StringIO | |
attr_accessor :original_filename | |
attr_accessor :content_type | |
end | |
before :cache, :convert_base64 | |
def convert_base64(file) |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.http.client.*; | |
import org.apache.http.client.entity.*; | |
import org.apache.http.client.methods.*; | |
import org.apache.http.entity.StringEntity; | |
import org.apache.http.impl.client.*; |