-
新しいrakeタスク assets:clean はプリコンパイルされたアセットを削除する。
-
--skip-gemfile
や--skip-bundle
なしでの、アプリケーションとプラグインのソース生成は、bundle installを走らせる -
jdbc*アダプターにとってのデータベースタスクを修正した
-
jdbcpostgresqlにとってのテンプレート生成
require 'digest/md5' | |
def gfm(text) | |
# Extract pre blocks | |
extractions = {} | |
text.gsub!(%r{<pre>.*?</pre>}m) do |match| | |
md5 = Digest::MD5.hexdigest(match) | |
extractions[md5] = match | |
"{gfm-extraction-#{md5}}" | |
end |
#!/bin/sh | |
screencapture -m -tjpg ~/tmp/capture.jpg | |
cat ~/tmp/capture.jpg | perl -npe 's/0/9/g' >~/tmp/glitched_capture.jpg | |
open /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app # set qtz file shows ~/tmp/glitched_capture.jpg |
#!/usr/bin/env ruby | |
CODES = { | |
'400' => 'Bad Request', | |
'401' => 'Unauthorized', | |
'403' => 'Forbidden', | |
'404' => 'Not Found', | |
'405' => 'Method Not Allowed', | |
'406' => 'Not Acceptable', | |
'408' => 'Request Timeout', |
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: says-dot-com-production | |
# Required-Start: $all | |
# Required-Stop: $network $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start the says-dot-com-production unicorns at boot | |
# Description: Enable says-dot-com-staging at boot time. | |
### END INIT INFO |
def revoke(user) | |
proxy_association.owner.tap do |project| | |
# You can't remove the last user with access (someone has to have access to the project!) | |
if project.users.many? | |
if user.pending? && user.projects.one? | |
user.destroy | |
else | |
project.users.delete(user) | |
user.touch | |
end |
script "add key" do | |
interpreter "bash" | |
user "root" | |
not_if "apt-key list | grep 7F0CEB10" | |
code <<-EOC | |
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
EOC | |
end | |
script "add aptline" do |
The latest release notes is available at http://edgeguides.rubyonrails.org/3_2_release_notes.html
-
Speed up development by only reloading classes if dependencies files changed. This can be turned off by setting
config.reload_classes_only_on_change
to false. José Valim -
New applications get a flag
config.active_record.auto_explain_threshold_in_seconds
in the environments configuration files. With a value of 0.5 in development.rb, and commented out in production.rb. No mention in test.rb. fxn -
Add DebugExceptions middleware which contains features extracted from ShowExceptions middleware José Valim
For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.
When creating a form with form_for
, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.
To allow new known fields to be added via JS, we could add:
#!/usr/bin/env ruby | |
CODES = { | |
'400' => 'Bad Request', | |
'401' => 'Unauthorized', | |
'403' => 'Forbidden', | |
'404' => 'Not Found', | |
'405' => 'Method Not Allowed', | |
'406' => 'Not Acceptable', | |
'408' => 'Request Timeout', |