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) |
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
#!/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
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
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
#!/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
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
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
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
(defun haml-convert-rhtml-file (rhtmlFile hamlFile) | |
"Convierte un fichero rhtml en un haml y abre un nuevo buffer" | |
(interactive "fSelect rhtml file: \nFSelect output (haml) file: ") | |
(let ((comando (concat "/usr/local/bin/html2haml -r " | |
rhtmlFile | |
" " | |
hamlFile))) | |
(shell-command comando) | |
(find-file hamlFile))) |
OlderNewer