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
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get autoremove | |
sudo apt-get install build-essential | |
sudo apt-get install mysql-server mysql-client libmysqlclient15-dev libmysql-ruby1.8 ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby irb1.8 libdbd-mysql-perl libdbi-perl libmysql-ruby1.8 libmysqlclient16-dev libmysqlclient16 libnet-daemon-perl libopenssl-ruby libopenssl-ruby1.8 libplrpc-perl libreadline-ruby1.8 libruby1.8 mysql-client mysql-client-5.1 mysql-common mysql-server mysql-server-5.1 rdoc1.8 ri1.8 ruby1.8 ruby1.8-dev zlib1g-dev | |
sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby | |
sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc |
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
function validateField(fieldId, alertMessage) { | |
if (document.getElementById(fieldId).value == "") { | |
alert(alertMessage); | |
document.getElementById(fieldId).focus(); | |
return false; | |
} else { | |
return true; | |
} | |
} |
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
require 'httpclient' | |
module EnomApi | |
def self.included(base) | |
base.send :extend, ClassMethods | |
end | |
module ClassMethods | |
def manage_with_enom | |
send :include, InstanceMethods | |
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
# 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 | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain | |
class ApplicationController < ActionController::Base |
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
# 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 |
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
# Examples of Nesting Associated Attributes | |
# This is a look at the various ways to set associated attributes through | |
# nested parameters. For example, let's say Project has_many :tasks and | |
# we want to update the tasks the same time we edit a project. There are | |
# several ways this interface could be handled, and here are a few. | |
# | |
# For these examples, we're trying to create two new tasks and update an | |
# existing task (with id 3) through a project. | |
# Approach 1 |
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
#!/usr/bin/ruby | |
require 'net/http' | |
require 'uri' | |
require 'yaml' | |
SUCCESS = 0 | |
TEMPORARY_FAIL = 75 | |
UNAVAILABLE = 69 | |
ENV['RAILS_ENV'] ||= 'production' |
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
/etc/postfix/main.cf: | |
mydestination = localhost.localdomain, localhost, list.domain.com | |
virtual_maps = hash:/etc/postfix/virtual | |
alias_maps = hash:/etc/aliases | |
/etc/postfix/virtual: | |
@list.domain.com rails_mailer | |
/etc/aliases: | |
rails_mailer: "|/path/to/app/lib/mail_handler.rb http://www.example.com/emails 298cc9dceb1f3cac91fef8b42be624c07843fc8e" |
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
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) | |
biff = no | |
# appending .domain is the MUA's job. | |
append_dot_mydomain = no | |
# Uncomment the next line to generate "delayed mail" warnings | |
#delay_warning_time = 4h | |
readme_directory = no |
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
require "digest/sha1" | |
module AuthenticationModel | |
def self.included(base) | |
base.send(:include, InstanceMethods) | |
base.send(:extend, ClassMethods) | |
base.send(:validates_presence_of, :email, :message => "L'indirizzo email è richiesto.") | |
base.send(:validates_presence_of, :password, :if => :password_required?, :message => "La password è richiesta.") | |
base.send(:validates_uniqueness_of, :email, :case_sensitive => false, :message => "Questo indirizzo email è già presente.") |
OlderNewer