- 博客(21)
- 资源 (1)
- 收藏
- 关注
原创 Mac上的TextMate安装coffee插件
1. 安装coffeebundlemkdir -p ~/Library/Application\ Support/TextMate/Bundlescd ~/Library/Application\ Support/TextMate/Bundlesgit clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeSc...
2011-11-28 14:31:03 255 1
原创 CentOS上部署安装
来源:http://www.webtatic.com/packages/git17/,http://www.betaquest.com/2011/07/how-to-install-rvm-ruby-version-manager-and-ruby-1-8-7-and-1-9-2-ree-on-centos-5-6-64bit/ 在centOS上的yum里没有找到git的安装包,按下面方法...
2011-11-04 17:51:46 115
原创 查看系统信息
1. uname -aLinux green 2.6.32-33-server #70-Ubuntu SMP Thu Jul 7 22:28:30 UTC 2011 x86_64 GNU/Linux 2. uname -mx86_64 3. cat /etc/lsb-release (Ubuntu) cat /etc/redhat-relea...
2011-11-04 14:07:52 104
原创 Chromium默认使用encrypted搜索
http://tech.shantanugoel.com/2011/05/12/use-encrypted-google-search-as-default-in-chrome.html来自:1. Click on the wrench/tool icon at the top of Google Chrome and go to Options.2. On the “Basics” ...
2011-09-08 17:26:49 189
原创 gem安装报错
在ubuntu11.04上安装mysql2的gem是报错 *** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers. Check the mkmf.log file for moredetai...
2011-08-18 10:09:53 576
原创 用Exception Notification发送邮件
在rails项目中,用Exception Notification,可以在程序异常时发送通知邮件。 1.安装gemgem 'exception_notification', :require => 'exception_notifier' 并bundle install 2.安装Exception Notification在config/initializ...
2011-07-07 14:57:19 168
原创 做技术的,不要搞封建迷信活动
美国通用汽车“香草冰淇淋”的故事可能很多人读过:有一天美国通用汽车公司的庞帝雅克(Pontiac)部门收到一封客户抱怨信,上面是这样写的:“这是我为了同一件事第二次写信给你,我不会怪你们为什么没有回信给我,因为我也觉得这样别人会认为我疯了,但这的确是一个事实。”我们家有一个传统的习惯,就是我们每天在吃完晚餐后,都会以冰淇淋来当我们的饭后甜点。由于冰淇淋的口味很多,所以我们家每天在饭后才...
2011-07-04 10:39:10 113
原创 Open Flash Chart with Rails3
http://pullmonkey.com/projects/open_flash_chart2 在rails3项目中安装OpenFlashChart的插件rails plugin install git://github.com/pullmonkey/open_flash_chart.git 在某个controller的action中 def index @g...
2011-06-30 15:21:43 101
原创 Ubuntu+SSH tunnels
http://yicaoyimu.com/?p=200 1. 打开terminal 输入如下命令:$ sudo ssh -qTfnN -D 7070 username@servername(7070表示用本地的7070端口)[sudo] password for ********:(输入本机super user密码)username@servername’s passwor...
2011-06-30 10:29:19 134
原创 Resque
Resqus: git://github.com/defunkt/resque.git来自于railscasts安装redis,并启动redissudo redis-server /etc/redis.conf 在项目中配置redis,在config/下新建resque.ymldefaults: &defaul...
2011-06-24 10:26:59 272
原创 Module Cache Sweeping
在项目的app下新建目录sweeper,在该目录下新建sweeper类的文件,如listen_sweeper.rbclass class ListenSweeper < ActionController::Caching::Sweeper observer User, Production #observer Model you wanted def afte...
2011-06-02 10:25:33 84
原创 Request as XML
If a controller need process all request as XML instead of HTML as default,you can code in this controller like thisbefore :force_to_xmlprivatedef force_to_xml request.format = :xml...
2011-05-31 15:51:45 123
原创 multiple routing files in rails3
in config/application.rb:config.paths.config.routes << File.join(Rails.root, "config/folder_name/route_file.rb")
2011-05-30 22:20:04 85
原创 undefined method 'task'问题
在rails3.0,rake0.9.0下,rake时会报undefined method `task'的错误,解决方法,在Rakefile文件中加入一下代码:require 'rake/dsl' 转自:http://www.aiseeu.com/blog/archives/501.html 说明:https://github.com/jimweirich/rake/pul...
2011-05-30 13:48:00 127
原创 在Mac下安装mit-scheme
《计算机程序的构造解释》里用到的语言是Lisp的一种方言scheme,记录一下mit-scheme在Mac下的安装过程。 1.首先看看本地是否安装过scheme,在命令行which scheme 如之前没安装过,则不会显示任何内容,如有,可以看看安装路径echo $MITSCHEME_LIBRARY_PATH 2.下载源码包,http://www.g...
2011-05-23 13:00:56 227
原创 Gem::Specification
在Mac OSX 10.6.7上运行gem update --system后,可能会出现: NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.Gem::Specification#default...
2011-05-19 13:19:13 873
原创 Textmate
一、安装TextMate 首先去网上下载一个TextMate_1.5.9.dmg镜像安装包,双击后执行文件夹中的TextMate。然后再下载一个TextMate.ttf中文字体包,双击进行安装。 二、破解TextMate 1、去除原来的注册码,打开终端,执行如下命令:defaults delete com.macromates.textmate 2、去下...
2011-05-10 12:42:25 281
原创 格式化时间
例如有个时间t = Time.now,格式化有:t.to_s(:long)t.to_s(:short)t.to_s(:db)还可以调用strftime方法加以参数:参看其参数,运行:ri Time.strftimeFormat meaning: %a - The abbreviated weekday name (``Sun'') %A - The full weekd...
2011-05-10 12:30:44 85
原创 Ubuntu9.10试用
9.10刚出来的时候安装过一次,还是alpha版的,界面是好看多了,可感觉好像慢了好多,可能是我机器配置低了点。拿到Ubnutu寄来的安装盘,再次体验一下。插入光盘,重启,选择语言后就没反应了,光驱也没动静了,于是重启在来,试到第三次时也正常能安装,奇怪的问题。中间怀疑是光驱问题,还拿8.04盘试了一下,试完再装9.10就好了,奇怪。装完安装ruby、gem、rails等,用sudo ...
2010-01-13 13:17:51 98
原创 Rails中的中文乱码问题
在看了heweiya的完美实现省市县三级连动后,也跟着做了一下,但出现了乱码问题。他在文中最后也提到乱码问题,写了个方法来解决:configure_charsets,但我发现却没有用,不知是不是mysql版本不同,好像有报错找不到header的定义。 后来发现robbin提到的:1、确定MySQL数据库编码是utf82、database.yml里面增加encoding:...
2010-01-05 16:20:56 128
原创 Rails中的check_box的List的一个应用
面试时遇到的一个问题,在产品列表前加个上check_box,选择一个或几个产品,提交后到checkout页面,输入客户信息,如email和address等信息后,提交保存。 开始的思路:把各个product的id传入check_box,提交后从params中获取选中的id值,再从数据库中,根据id值在checkout页面中列出相应的product的信息。首先:在check_b...
2010-01-05 15:27:35 108
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人