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
| FLASH_NOTICE_KEYS = [:error, :notice, :success] | |
| def flash_messages | |
| return unless messages = flash.keys.select{|k| FLASH_NOTICE_KEYS.include?(k)} | |
| formatted_messages = messages.map do |type| | |
| content_tag :div, :class => "flash #{type}" do | |
| flash_message_for(flash[type]) | |
| end | |
| end | |
| formatted_messages.join |
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
| FLASH_NOTICE_KEYS = [:error, :notice, :warning, :message, :success] | |
| def flash_messages | |
| return unless messages = flash.keys.select{|k| FLASH_NOTICE_KEYS.include?(k)} | |
| formatted_messages = messages.map do |type| | |
| content_tag :div, :class => "#{type}Explanation" do | |
| flash_message_for(flash[type]) | |
| end | |
| end | |
| formatted_messages.join |
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
| var actualizarConductores = function(element) { | |
| $$('select.conductor').each(function(s) { | |
| actualizarSelect(s, element.value, 'Seleccione un conductor', conductores); | |
| }); | |
| }; | |
| var filtrarConductores = Behavior.create({ | |
| initialize : function() {actualizarConductores(this.element);}, | |
| onchange : function() {actualizarConductores(this.element);} | |
| }); |
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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'logger' | |
| class UrlParser | |
| attr_reader :url, :file, :line, :column | |
| def initialize(url) | |
| @url = url | |
| parse_url | |
| end |
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
| Go to: about:config in firefox | |
| right click and create a new boolean property: | |
| network.protocol-handler.external.emacs -> true |
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
| if defined?(Footnotes) | |
| Footnotes::Filter.prefix = 'emacs://open?url=file://%s&line=%d&column=%d' | |
| end | |
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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'logger' | |
| class UrlParser | |
| attr_reader :url, :file, :line, :column | |
| def initialize(url) | |
| @url = url | |
| parse_url | |
| end |
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
| # parent model | |
| def readonly? | |
| state == "closed" && !changed.include?('state') | |
| end | |
| # child model | |
| def readonly? | |
| # ... | |
| parent.state == "closed" | |
| # ... |
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
| namespace :monit do | |
| namespace :debian do | |
| desc <<-DESC | |
| Install monit. | |
| "Source":#{link_to_source(__FILE__)} | |
| DESC | |
| task_arg(:monit_port, "Monit port", :default => 2812) |
NewerOlder