Create a websites
user.
sudo adduser --disabled-password --home /src/websites websites
Login and install dropbox.
sudo -s su - websites
#Heroku, Ruby on Rails and PhantomJS
In this post, I’m going to show you how to modify an existing Ruby on Rails app running on Heroku’s Cedar stack to use PhantomJS for screen scraping. If you’ve never heard of PhantomJS, it’s a command-line WebKit-based browser (that supports JavaScript, cookies, etc.).
Let’s get started. This is a high-level overview of the required steps:
/* Flatten das boostrap */ | |
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid { | |
-moz-box-shadow: none !important; | |
-webkit-box-shadow: none !important; | |
box-shadow: none !important; | |
-webkit-border-radius: 0px !important; | |
-moz-border-radius: 0px !important; | |
border-radius: 0px !important; | |
border-collapse: collapse !important; | |
background-image: none !important; |
// Service for checking the availability of a given word | |
Splitter.module('Checkers', function(Checkers, Splitter) { | |
var LocalChecker = { | |
comKeyFor: function(compound) { | |
return 'avail/.com/' + compound; | |
}, | |
check: function(compound) { |
module ApplicationHelper | |
# pretty page titles | |
# yield_for(:title, 'default text goes here') in layout | |
# content_for(:title, 'some text') in view | |
def yield_for(content_sym, default) | |
output = content_for(content_sym) | |
output = default if output.blank? | |
output | |
end | |
end |
# 1) Point *.example.com in your DNS setup to your server. | |
# | |
# 2) Setup an Apache vhost to catch the star pointer: | |
# | |
# <VirtualHost *:80> | |
# ServerName example.com | |
# ServerAlias *.example.com | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain |