对大多数网站来说,访客实际使用的第一个功能就是注册&登陆,而整个注册&登陆流程的简洁流畅与否往往决定了访客的第一印象.下面结合在YMate.me开发过程中学到的些许经验,和大家探讨下.
通常做法,自建注册表单.
好处是:
可以自定义需要的资料,不必担心第三方登陆接口缺乏必要的信息.
# encoding = UTF-8 | |
require 'rest-client' | |
require 'nokogiri' | |
url = 'http://icp.chinaz.com/searchs' | |
targets = [] | |
result = '' | |
IO.foreach(ARGV.first) { |s| targets << s.sub("\n", "\r\n") } | |
data = { urls: targets.join, btn_search: '查询' } | |
back = RestClient.post(url, URI.encode_www_form(data)) |
apt-get update | |
apt-get upgrade -y | |
apt-get install -y make gcc git-core htop libreadline-dev bison tar libssl-dev zlib1g-dev bzip2 libpcre3-dev | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
cd ~/.rbenv && src/configure && make -C src | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
~/.rbenv/bin/rbenv init | |
echo 'eval "$(rbenv init -)"' >>~/.bashrc | |
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build | |
export PATH="$HOME/.rbenv/bin:$PATH" |
#!/bin/bash | |
/usr/local/nginx/sbin/nginx -s stop | |
apt-get -y install gcc libpcre3-dev zlib1g-dev make | |
wget http://tengine.taobao.org/download/tengine-1.5.2.tar.gz | |
mv -f tengine-1.5.2.tar.gz /data/www | |
cd /data/www | |
tar xvzf tengine-1.5.2.tar.gz | |
cd tengine-1.5.2/ | |
sed -i '/CFLAGS="$CFLAGS -g"/d' auto/cc/gcc | |
./configure --with-http_gzip_static_module --with-http_sysguard_module --with-http_stub_status_module --with-http_realip_module --without-dso --without-http_ssl_module --without-http_auth_basic_module --without-http_autoindex_module --without-http_geo_module --without-http_map_module --without-http_split_clients_module --without-http_split_clients_module --without-http_uwsgi_module --without-http_scgi_module --without-http_memcached_module --without-http_browser_module --without-http_upstream_check_module --without-http_upstream_ip_hash_module |
隐私政策是服务中非常重要的部分,它向用户传达你的"不作恶"底线在哪.鉴于大段的文字让人难以阅读,我们仅就用户最关心的数据安全做出回应:
**数据是用户的.**除了为您提供服务外的必要权限,您拥有所有权限.
**数据是受保护的.**数据默认私有,我们不会查看、分析、共享这些数据,也不会用做数据挖掘.除非您授权或您违反了相关法律法规.
**数据是可转移的.**您可以随时迁入迁出YMate,我们不会设置任何障碍.
我们不会主动记录您的任何密码信息,我们甚至在Web日志中专门过滤了密码.
所有的坑都来自于 无知 ,这次也不例外,我又掉坑里了...
先来看段代码:
def change
add_column :servers, :vip_date, :date, :default => Date.today
end
这是一个很常见的迁移任务,新增一栏,设置默认值.执行迁移也毫无警告,看起来一切都那么美好.而真相其实是这样的:
[2013-04-13 09:55:40] /Users/lianlian/.rvm/rubies/ruby-1.9.3-p392/bin/ruby | |
current path: /Users/lianlian/.rvm/src/rubygems-1.8.25 | |
command(7): env GEM_PATH=/Users/lianlian/.rvm/gems/ruby-1.9.3-p392:/Users/lianlian/.rvm/gems/ruby-1.9.3-p392@global:/Users/lianlian/.rvm/gems/ruby-1.9.3-p392:/Users/lianlian/.rvm/gems/ruby-1.9.3-p392@global GEM_HOME=/Users/lianlian/.rvm/gems/ruby-1.9.3-p392 /Users/lianlian/.rvm/rubies/ruby-1.9.3-p392/bin/ruby -d /Users/lianlian/.rvm/src/rubygems-1.8.25/setup.rb --verbose | |
Exception `LoadError' at /Users/lianlian/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rubygems.rb:1264 - cannot load such file -- rubygems/defaults/operating_system | |
Exception `LoadError' at /Users/lianlian/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/rubygems.rb:1273 - cannot load such file -- rubygems/defaults/ruby | |
/Users/lianlian/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>': | |
It seems your ruby installation is missing psych (for YAML output). | |
To eliminate this warning, please install lib |