This file contains 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
if Rails.env.development? | |
FileUtils.mkdir_p(Rails.root.join('config', 'certs')) | |
key_path = Rails.root.join('config', 'certs', 'development.key') | |
crt_path = Rails.root.join('config', 'certs', 'development.crt') | |
unless File.exist?(key_path) && File.exist?(crt_path) | |
def cert_domain | |
'localhost' # Setting[:cookie_domain] || 'localhost' | |
end |
This file contains 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
module ArelHelpers | |
extend self | |
def self.included(base) | |
base.extend self | |
end | |
def asterisk(arel_table_or_model) | |
arel_table, columns = case arel_table_or_model | |
when Arel::Table |
This file contains 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
# http://zh.wikipedia.org/wiki/中文数字 | |
# http://china.younosuke.com/03_013.html | |
module ChineseNum | |
extend self | |
UPPER_ZERO = '零' | |
LOWER_ZERO = '〇' | |
UPPER_DIGITS = %w[壹 贰 叁 肆 伍 陆 柒 捌 玖].unshift nil | |
LOWER_DIGITS = %w[一 二 三 四 五 六 七 八 九].unshift nil |
This file contains 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
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
This file contains 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
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
zh-TW: | |
devise: | |
confirmations: | |
confirmed: "您的帳號已通過驗證,現在您已成功登入。" | |
send_instructions: "您將在幾分鐘後收到一封電子郵件,內有驗證帳號的步驟說明。" | |
send_paranoid_instructions: "如果我們有您的信箱,您將會收到一封驗證您的帳號的電子郵件。" | |
failure: | |
already_authenticated: "您已經登入。" |
This file contains 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 setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS | |
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing). | |
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here: | |
* Heroku Hostname SSL | |
* GoDaddy Standard SSL Certificate | |
* Zerigo DNS |