升级Leopard默认JDK版本至1.6

1. 打开 /Application/Utilities/Java Preferences.app
2. 分别在"Java Applet plugin"和"Java Application"中将"Java SE 6 (64bit)"拖动到列表的顶端;
3. 在终端执行以下命令(貌似不执行也可以):

 cd /System/Library/Frameworks/JavaVM.framework/Versions
 sudo mv CurrentJDK CurrentJDK.orig

4. java(c) -version 查看版本.

BTW: go to here to download Eclipse 64bit for Mac.

Ruby中的日期格式化

%a - The abbreviated weekday name (``Sun'')
%A - The full weekday name (``Sunday'')
%b - The abbreviated month name (``Jan'')
%B - The full month name (``January'')
%c - The preferred local date and time representation
%d - Day of the month (01..31)
%H - Hour of the day, 24-hour clock (00..23)
%I - Hour of the day, 12-hour clock (01..12)
%j - Day of the year (001..366)
%m - Month of the year (01..12)
%M - Minute of the hour (00..59)
%p - Meridian indicator (``AM'' or ``PM'')
%S - Second of the minute (00..60)
%U - Week number of the current year, starting with the first Sunday as the first day of the first week (00..53)
%W - Week number of the current year, starting with the first Monday as the first day of the first week (00..53)
%w - Day of the week (Sunday is 0, 0..6)
%x - Preferred representation for the date alone, no time
%X - Preferred representation for the time alone, no date
%y - Year without a century (00..99)
%Y - Year with century
%Z - Time zone name
%% - Literal ``%'' character

Translates Authlogic validates message

  authlogic:
    error_messages:
      login_blank: can not be blank
      login_not_found: is not valid
      login_invalid: should use only letters, numbers, spaces, and .-_@ please.
      consecutive_failed_logins_limit_exceeded: Consecutive failed logins limit exceeded, account is disabled.
      email_invalid: should look like an email address.
      password_blank: can not be blank
      password_invalid: is not valid
      not_active: Your account is not active
      not_confirmed: Your account is not confirmed
      not_approved: Your account is not approved
      no_authentication_details: You did not provide any details for authentication.
    models:
      user_session: UserSession (or whatever name you are using)
    attributes:
      user_session: (or whatever name you are using)
        login: login
        email: email
        password: password
        remember_me: remember me

使用Postfix, Courier及MySql构建自已的邮件服务器

本文将介绍如何在Ubuntu上运行Postfix邮件系统, 使用Courier提供IMAP/POP3(IMAPS and POP3S)服务, 并将虚拟域和用户数据保存于MySql中.

1. 安装必须的软件包

apt-get install postfix postfix-mysql postfix-doc mysql-client mysql-server courier-authdaemon \
        courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl \
        libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl

安装过程中需要输入MySql的root密码, 在选择邮件服务器类型时选择"Internet Site", 在输入system mail name
时请输入一个完整的域名并指向服务器的IP地址.

继续阅读 »

使用Fancy-Buttons制作漂亮的按钮

Fancy Buttons

Fancy Buttons是一个优雅的按钮样式生成器, 正如上图所示, 用它可以制作出多种漂亮的按钮.

安装

$sudo gem install fancy-buttons compass-colors

独立使用

$compass -r compass-colors -r fancy-buttons -f fancy-buttons your_project_name

与Rails集成

$compass --rails -r compass-colors -r fancy-buttons -f fancy-buttons --css-dir=public/stylesheets --sass-dir=app/sass . 
  1. 1
  2. 2
  3. 3
  4. 4
  5. ...
  6. 25