Forked from CSS only Custom Radio Buttons.
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
attachments: parent_id, asset_id | |
domain_names: organisation_id | |
event_memberships: user_id, event_id | |
events: editor_id | |
group_actions: user_id, group_id | |
groups: user_id | |
icons: parent_id | |
invitations: sender_id | |
legacy_actions: item_upon_id | |
news_items: author_id |
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 ActiveRecord | |
class Base | |
# extends the patch here: http://www.xcombinator.com/2008/08/11/activerecord-from_xml-and-from_json-part-2/ | |
def self.array_from_xml(xml) | |
hash_array = Hash.from_xml(xml).values.first | |
hash_array.nil? ? [] : hash_array.collect {|attributes_hash| from_hash(attributes_hash)} | |
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
# rake yoursite:setup_gateway | |
namespace :yoursite | |
desc "Set up gateway" | |
task :setup_gateway => :environment do | |
Gateway.transaction do | |
auth_net = "Authorize.net" | |
gateway = Gateway.find_by_name_and_environment(auth_net, RAILS_ENV) | |
gateway.destroy unless gateway.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
module MigrationHelper | |
#options are: | |
# :pk_table_name | |
# :pk_column_name | |
# :cascade_delete | |
# :cascade_update | |
def add_fk(fk_table_name, fk_column_name, options={}) | |
fk_table_name = fk_table_name.to_s | |
fk_column_name = fk_column_name.to_s | |
pk_table_name = options[:pk_table_name] || fk_column_name[0, fk_column_name.index("_id") || fk_column_name.length].pluralize |
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
[color] | |
diff = auto | |
branch = auto | |
status = auto | |
ui = auto | |
[alias] | |
co = checkout | |
ci = commit -am | |
st = status | |
br = branch |
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
# Samples for formatting additional Product fields in Spree Admin | |
# SelectField: adds a select box with values 1..20 | |
# WideField: adds a standard text box, but with a specified size | |
# HugeField: adds a text area with a specified number of columns | |
Variant.additional_fields += [ | |
{ :name => 'SelectField', | |
:only => [:product], | |
:use => 'select', | |
:value => Proc.new{ (1..20).collect{|i| [i,i]} } |
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
def cloud_image_path(source) | |
if %w{development test}.include?(Rails.env) || request.ssl? | |
image_path(source) | |
else | |
"http://yourpath.cdn.rackspacecloud.com/" + source.split("/").last | |
end | |
end | |
def cloud_image_tag(source, options={}) | |
image_tag(cloud_image_path(source), options) |
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
rvm update | |
rvm reload | |
rvm install 1.9.2 | |
rvm gemset copy 1.9.1 1.9.2 | |
rvm 1.9.2 | |
sudo port install sqlite3 | |
gem update sqlite3-ruby | |
gem uninstall ruby-debug19 ruby-debug-base19 columnize linecache19 |
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
%h1 Uptime | |
= image_tag uptime_image_path, :height => "165", :width => "300" |
OlderNewer