This file contains hidden or 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
| * How to compile and install | |
| This is what you need to do to compile and install Ruby: | |
| 1. If ./configure does not exist or is older than configure.in, | |
| run autoconf to (re)generate configure. | |
| 2. Run ./configure, which will generate config.h and Makefile. | |
| Some C compiler flags may be added by default depending on your |
This file contains hidden or 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
| # | |
| # Based upon the NCSA server configuration files originally by Rob McCool. | |
| # | |
| # This is the main Apache server configuration file. It contains the | |
| # configuration directives that give the server its instructions. | |
| # See http://httpd.apache.org/docs/2.2/ for detailed information about | |
| # the directives. | |
| # | |
| # Do NOT simply read the instructions in here without understanding | |
| # what they do. They're here only as hints or reminders. If you are unsure |
This file contains hidden or 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
| #yum install curl-devel as root | |
| #yum remove as root | |
| #yum install httpd | |
| #yum install httpd-devel | |
| #yum install apr-devel | |
| #yum install apr-util-devel | |
| #passenger-install-apache2-module |
This file contains hidden or 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
| So, have you started to work with rails 3? Did you realize that your UTF-8 databases doesn’t work nice with mysql? This is because the mysql gem works with ASCII-8BIT encoding, but ruby 1.9 and rails 3 works with UTF-8 encoding, so when you create a model into the database, everything works fine, but when you work with those models, it doesn’t works so nice and you don’t get what you stored. | |
| What’s the solution? Well, there are actually three solutions, the most recommended, use mysql2, |
This file contains hidden or 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
| blackmac001:ten bill$ cap deploy:setup | |
| triggering start callbacks for `deploy:setup' | |
| * executing `multistage:ensure' | |
| *** Defaulting to `staging' | |
| * executing `staging' | |
| * executing `deploy:setup' | |
| * executing "mkdir -p /home/staging/www/ten /home/staging/www/ten/releases /home/staging/www/ten/shared /home/staging/www/ten/shared/system /home/staging/www/ten/shared/log /home/staging/www/ten/shared/pids" | |
| servers: ["myserver.com"] | |
| [myserver.com] executing command |
This file contains hidden or 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
| ################################################################ | |
| # For views/migrations etc. check http://tinyurl.com/3xfx3zm # | |
| ################################################################ | |
| # File : RAILS_APP/config/initializers/devise.rb | |
| # Change the following only. Rest can stay same | |
| # NOTE : You must use devise master or any version released after Mar 13, 2011 to get everything mentioned here working. | |
| config.authentication_keys = [ :login ] | |
| config.confirmation_keys = [ :login ] | |
| config.unlock_keys = [ :login ] |
This file contains hidden or 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
| var regexEnum = | |
| { | |
| cn_username:"(?!_)(?![0-9])^[-_a-zA-Z0-9\u4e00-\u9fa5]", //用来用户注册。匹配由数字、26个英文字母、中文字符或者下划线组成的字符串 | |
| password:"^[-_a-zA-Z0-9]{6,16}$", | |
| email:"^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$", //邮件 | |
| mobile:"^(13|15|18)[0-9]{9}$", //手机 | |
| msn:"^([a-z][a-z0-9\_\.]*[a-z0-9])(@)(([a-z0-9][a-z0-9\-]*[a-z0-9][\.])+(com|cn|net|hk|tw|au|uk|de|tv|info|biz))$",//msn | |
| telephone:"(^(\d{2,4}[-_-—]?)?\d{3,8}([-_-—]?\d{3,8})?([-_-—]?\d{1,7})?$)|(^0?1[35]\d{9}$)",//固定电话 | |
| tel:"^(([0\\+]\\d{2,3}-)?(0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$", //电话号码的函数(包括验证国内区号,国际区号,分机号) | |
| zipcode:"^\\d{6}$", //邮编 |
This file contains hidden or 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 -*- | |
| $:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path. | |
| require "rvm/capistrano" # Load RVM's capistrano plugin. | |
| set :rvm_ruby_string, '1.9.2' # Or whatever env you want it to run in. | |
| require 'bundler/capistrano' | |
| set :application, "yourapp" | |
| set :use_sudo, false |
This file contains hidden or 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 -*- | |
| $:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path. | |
| require "rvm/capistrano" # Load RVM's capistrano plugin. | |
| set :rvm_ruby_string, '1.9.2' # Or whatever env you want it to run in. | |
| require 'bundler/capistrano' | |
| set :application, "YourApp" |
This file contains hidden or 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
| class MigrateUserToDevise < ActiveRecord::Migration | |
| def self.up | |
| change_table :users do |t| | |
| t.string :encrypted_password, :null => false, :limit => 128 | |
| # ... | |
| end | |
| end | |
| def self.down | |
| end |