This:
ffmpeg -i in.mov -pix_fmt rgb24 -r 24 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
Is generally nice with a Quicktime Player screen cap.
# Add this to config/environments/development.rb | |
# Limit your development log file to 5 MB | |
config.logger = Logger.new(config.paths["log"].first, 1, 5242880) # 5 megabytes |
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
end |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.