This file contains hidden or 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
| require 'rubygems' | |
| require 'rails' | |
| require 'rbconfig' | |
| require 'rails/script_rails_loader' | |
| require 'rails/ruby_version_check' | |
| Signal.trap("INT") { puts; exit } |
This file contains hidden or 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 My | |
| module Module | |
| module Is | |
| module Great | |
| def self.included(klass) | |
| klass.class_eval do | |
| before_filter :filter_me | |
| def filter_me | |
| raise "I DO NOT LIKE FAILURES!" if params.has_key? :failure |
This file contains hidden or 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
| has_many has_many | |
| Page ----------------> PageTranslation -----------> PagePart | |
| parent_id page_id page_translation_id | |
| position locale title # We might want to rename this to name | |
| path title body | |
| timestamps meta_keywords | |
| show_in_menu meta_description | |
| link_url custom_title | |
| menu_match browser_title | |
| deletable timestamps |
This file contains hidden or 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 plugins=(next_plugin_names) | |
| next_plugin_names.sort! | |
| current_plugin_names = self.plugins.collect { |p| p.name }.sort! | |
| # Nothing changed? Do nothing | |
| return if current_plugin_names == next_plugin_names | |
| # Add extra plugins, if there are more assigned, compared to before | |
| next_plugin_names.each do |new| | |
| if current_plugin_names.member? new |
This file contains hidden or 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
| <body class="wym_iframe page_part_body"> | |
| <p> | |
| Welcome to our site. This is just a place holder page while we gather our content. | |
| <img src="[object HTMLParagraphElement]" class=""> | |
| </p> | |
| </body> |
This file contains hidden or 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
| require "config/environment" | |
| count = Rim.count | |
| Rim.all.each_with_index do |rim, i| | |
| if rim.rim_photo.file? | |
| puts "rim #{i} of #{count} +" | |
| rim.photo = File.open((Rails.root.to_s + '/public' + rim.rim_photo.url).split("?").first) | |
| rim.save | |
| else | |
| puts "rim #{i} of #{count} -" |
This file contains hidden or 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
| Partition GB | |
| / 10 | |
| /home 20 | |
| swap 10 | |
| /vservers/mysql 50 | |
| /vservers/production 50 | |
| /vservers/mail 50 | |
| /vservers/bind 4 | |
This file contains hidden or 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
| #Original: | |
| # if groups | grep -q rvm ; then | |
| # source "/usr/local/lib/rvm" | |
| # fi | |
| # Doesnt work, since | |
| # $ groups => root | |
| # $ groups `whoami` => root : root rvm | |
| # |
This file contains hidden or 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
| <VirtualHost *:80> | |
| ServerName main.fr | |
| ServerAlias main.com | |
| ServerAlias sub.main.fr | |
| ServerAlias sub.main.com | |
| DocumentRoot /var/www/html/prod/current/public | |
| </VirtualHost> |
This file contains hidden or 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
| # | |
| # i've represented this tree as the array 'tree'. | |
| # A B C F G K | |
| # / \ / \ | |
| # D E H J | |
| # / | |
| # I | |
| # | |
| # According to the nested set rules, the following output should be given: | |
| # 1-A-2 3-B-4 5-C-10 11-F-12 13-G-20 21-K-22 |