save_and_open_page
have_button(locator)| # Sinatra sample app. | |
| # | |
| # Usage: | |
| # $ sudo gem install sinatra | |
| # $ ruby this_file.rb | |
| # $ open http://0.0.0.0:4567/ | |
| require "rubygems" | |
| require "sinatra" | |
Changes:
this version includes backport of Greg Price's patch for speedup startup http://bugs.ruby-lang.org/issues/7158 .
ruby-core prefers his way to do thing, so that I abandon cached-lp and sorted-lf patches of mine.
this version integrates 'array as queue' patch, which improves performance when push/shift pattern is heavily used on Array.
This patch is accepted into trunk for Ruby 2.0 and last possible bug is found by Yui Naruse. It is used in production* for a couple of months without issues even with this bug.
| require 'mina/bundler' | |
| require 'mina/rails' | |
| require 'mina/git' | |
| require 'mina/rvm' | |
| # Usually mina focuses on deploying to one host and the deploy options are therefore simple. | |
| # In our case, there is a number of possible servers to deploy to, it is therefore necessary to | |
| # specify the host that we are targeting. | |
| server = ENV['server'] | |
| # Since the same host can have multiple applications running in parallel, it is necessary to |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
#Simple Authentication with Bcrypt
This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.
The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).
You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault
##Steps
| brew update | |
| brew link yasm | |
| brew link x264 | |
| brew link lame | |
| brew link xvid | |
| brew install ffmpeg | |
| ffmpeg wiki: | |
| https://trac.ffmpeg.org/wiki/Encode/MP3 |
| # busca as chaves de um processo específico | |
| Resque.redis.keys('*.DailyReportCachedProcessor') | |
| # => ["concurrent.count.DailyReportCachedProcessor", "concurrent.queue_availability.DailyReportCachedProcessor", "concurrent.queue.high.DailyReportCachedProcessor"] | |
| # verifique quantos jobs dessse processo estao rodando no resque | |
| # utilize a chave concurrent.count.* para setar | |
| Resque.redis.set('concurrent.count.DailyReportCachedProcessor', 8) | |
| # limpar a lista |