Optimize non-Apple SSDs on OS X. (Run the following commands in the terminal.)
Enable TRIM support
Check IOAHCIBlockStorage version:
open /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/version.plist
Optimize non-Apple SSDs on OS X. (Run the following commands in the terminal.)
Check IOAHCIBlockStorage version:
open /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/version.plist
# config/initializers/postgresql_patches.rb | |
module ActiveRecord | |
module ConnectionAdapters | |
class PostgreSQLAdapter | |
def quote_table_name(name) | |
schema, name_part = extract_pg_identifier_from_name(name.to_s) | |
return quote_column_name(schema) unless name_part | |
table_name, name_part = extract_pg_identifier_from_name(name_part) | |
"#{quote_column_name(schema)}.#{quote_column_name(table_name)}" |
location = /videos/ { | |
upload_pass_form_field "^video"; | |
upload_store /path/to/your/app/tmp/upload; | |
upload_pass @large_upload; | |
upload_pass_args on; | |
upload_store_access all:rw; | |
upload_set_form_field "$upload_field_name[name]" "$upload_file_name"; | |
upload_set_form_field "$upload_field_name[content_type]" "$upload_content_type"; | |
upload_set_form_field "$upload_field_name[path]" "$upload_tmp_path"; | |
upload_aggregate_form_field "$upload_field_name[md5]" "$upload_file_md5"; |
module Paperclip | |
class Attachment | |
class UploadedPath | |
attr_reader :original_filename, :content_type, :size, :path | |
def initialize(uploaded_file) | |
@original_filename = uploaded_file["name"].downcase | |
@content_type = uploaded_file["content_type"].to_s.strip | |
@file_size = uploaded_file["size"].to_i | |
@path = uploaded_file["path"] |
module ActiveSupport | |
# Wrapping a string in this class gives you a prettier way to test | |
# for equality. The value returned by <tt>Rails.env</tt> is wrapped | |
# in a StringInquirer object so instead of calling this: | |
# | |
# Rails.env == "production" | |
# | |
# you can call this: | |
# | |
# Rails.env.production? |