- 博客(15)
- 收藏
- 关注
原创 ubuntu 11.04 rvm 安装rails开发环境的实践
RVM is not a function 答案: rvm alias create default 1.9.2 source ~/.bash_profile vim ~/.bash_profile [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function ruby 安
2012-02-28 11:20:29 1232
原创 产品维护和分析过程中用的着的一些小技巧
如何通过日志文件分析出哪一个action使用的时间最多? cat log/development.log | awk '/Completed/ { print "[" $3 "] - " $0 }' | sort -nr 如何过滤pasword, 适合rails 2.x application_controller.rb filter_parameter_logging :pass
2012-02-28 10:56:58 478
原创 nginx 服务器端配置可以重用的几段代码
1, gzip压缩 gzip on; gzip_min_length 1024; gzip_buffers 4 8k; gzip_types text/javascript text/plain application/x-javascript text/css application/xml; 2, 浏览器缓存 passenger_en
2012-02-23 17:28:14 972
原创 使用jquery mobile进行移动网页开发
我所使用的技术是: jquery mobile, jwplayer(因为需要播放视频文件) 需要做的页面分析: 1,一个视频的列表页面 2, 单个视频的播放页面 先准备一个固定的模板 酷拍手机视频聊天 酷拍手机视频聊天
2012-02-23 16:52:49 2252
原创 rails如何将数据传递到js中?
这个问题非常常见,我们经常需要将rails 中的数据传递到js变量中,然后在呈现在web页面上。前几天我就遇到了这个需求。 问题描述:我需要使用Hightcharts呈现数据,所以,我需要将数据存在在js的数组里。当时我的办法是 在application_helper.erb中新增如下方法 def rarray_to_js(arr) if arr.first.is_a? Integer
2012-02-16 14:34:42 2110
原创 bootstrap 与 rails 2.3.8整合之:will_paginate插件的使用
新增render, application_helper.erb class BootstrapLinkRenderer < ::WillPaginate::LinkRenderer def initialize #@gap_marker = @template.content_tag :li, @template.content_tag(:link(super, '#')), :c
2012-02-15 12:56:46 1251
原创 我在网站开发过程中,seo方面的一些心得
1, keywords, description要做好 2, 每个不同的页面,title要精确 3, 内容为王 4, img 的alt属性 5, 网站的加载速度和 js 的延时解析(应该将js文件放到最后) 6, 网站的连接最好不要带 ? 动态参数,可以是 /x/x/x 7, 需要做一个网站地图 /sitemap.xml 格式如下 http://www.paii.cn 20
2012-02-14 11:40:42 853
原创 验证js代码是否错误的网站
http://www.jshint.com/ 很强大 Js开发必备 icon下载网站 http://glyphicons.com/
2012-02-11 12:28:28 624
原创 google map的问题
问题描述: 在使用google map2的时候,需要给一个display属性为none的div 初始化一个地图,但是这个地图无法居中,该如何做呢? 解决办法 div的属性不要设置display为none, 应该使用如下的定义 left: -10000px; position: absolute; 要显示的时候,将left:0; 即可
2012-02-09 19:03:42 607
原创 rails3.2 开发过程中的一些总结
1, Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. update Gemfile文件 gem 'execjs' gem 'therubyracer' bundle install 2, can't c
2012-02-09 16:03:01 1660
原创 如何提升网页的加载速度?
首先,应该有一个好的服务器。这是根本要素。如果在这个基础上谈提升网页的加载速度应该如何做呢? 1,选取一款测试网页加载速度的工具 firefox 的插件 page speed http://code.google.com/intl/zh-CN/speed/page-speed/ 2, 根据page speed的建议操作,如下是我的一些总结 2.1 首先做rails的页面缓存 cache
2012-02-06 11:48:33 796
原创 服务器监控软件monit部署实践
monit是一款功能非常强大的服务器监控软件,如下是我实践部署的经验。 1, 下载软件,并安装 wget http://mmonit.com/monit/dist/monit-5.2.5.tar.gz tar zxvf monit-5.2.5.tar.gz ./configure make make install 2, 查看Monit的程序路径 which monit m
2012-02-03 11:55:33 1282
原创 heroku 使用笔记
1, 如何checkout heroku上的代码,修改并提交 git clone git://heroku的地址 提交: git remote add heroku git@heroku.com:newname.git 然后运行如下命令 git push heroku master 2, 使用heroku初始化项目的步骤 git init git add . git
2012-02-01 19:18:16 817
原创 rails 3.0 的utf-8编码问题
有一个gem可以给所有的文件加#encoding: utf-8 gem install magic_encodings magic_encoding
2012-02-01 10:30:18 813
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人