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
line = " Transferencia al C.Cost 9100000012 -594,00 15/03/10 traspas fundacio A.Mass\363" | |
regexp = /^(.+)\s+([-|\d|\.|,]+)\s+(\d+\/\d+\/\d+)\s+(.+)*$/ | |
line.match(regexp) # => 1min at 100% cpu usage |
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
Status: 500 Internal Server Error | |
uninitialized constant MysqlCompat::MysqlRes |
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
result = false or true # => true | |
result # => false | |
result = false || true # => true | |
result # => 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
def create | |
@roseta = Roseta.new(params[:roseta]) | |
if @roseta.save | |
flash[:notice] = 'Roseta creada.' | |
lastros = Roseta.find(:first,:order=>"id desc") | |
redirect_to :action => 'edit', :id => lastros.id | |
else | |
@errors = 'd' | |
render :action => 'new' | |
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
root@ip-10-224-81-194:/etc/chef# chef-client | |
/usr/lib/ruby/1.8/net/http.rb:2097:in `error!': 400 "Bad Request" (Net::HTTPServerException) | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.6.2/lib/chef/rest.rb:227:in `run_request' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.6.2/lib/chef/rest.rb:90:in `post_rest' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.6.2/lib/chef/client.rb:205:in `authenticate' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.6.2/lib/chef/client.rb:70:in `run' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.6.2/bin/chef-client:125 | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.6.2/bin/chef-client:119:in `loop' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.6.2/bin/chef-client:119 | |
from /usr/bin/chef-client:19:in `load' |
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 'spider' # sudo gem install spider | |
Spider.start_at('http://localhost/') do |s| | |
# Limit the pages to just this domain. | |
s.add_url_check do |a_url| | |
a_url =~ %r{^http://localhost.*} | |
end | |
# Handle 404s. |
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 get_images | |
require 'action_controller' | |
require 'action_controller/test_process.rb' | |
require 'mime/types' # gem install mime-types | |
@log = Array.new | |
@posts = WpaPost.find :all | |
@results = Array.new | |
# hacer un bucle recorriendo lo que sea que tiene las posibles imagenes. |
NewerOlder