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
| # A custom initializer that enables sorting via custom scopes in Ransack (like the same feature in MetaSearch) | |
| module Ransack | |
| module Adapters | |
| module ActiveRecord | |
| class Context < ::Ransack::Context | |
| # Allows for sorting by custom scopes | |
| # | |
| # |
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 :db do | |
| desc "Update and create SQL views" | |
| task :views => :environment do | |
| Dir["#{Rails.root}/db/sql_views/*.sql"].each do |file_name| | |
| STDERR.puts "Applying the SQL view at #{file_name}" | |
| source_file = File.new(file_name, 'r') | |
| if source_file and (sql_content = source_file.read) | |
| ActiveRecord::Base.transaction do | |
| # Each statement ends with a semicolon followed by a newline. |
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
| # Assume we are in your home directory | |
| cd ~/ | |
| # Clone the repo from GitLab using the `--mirror` option | |
| $ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git | |
| # Change into newly created repo directory | |
| $ cd ~/my-repo.git | |
| # Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks. |
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
| Refinery CMS: | |
| Caching images generated by Dragonfly with Nginx cache_proxy instead of Rack:Cache | |
| Before: | |
| Static image served by Nginx: 4409.40 req/sec (mean) | |
| Dragonfly generated images from Rack:Cache: 286.66 req/sec (mean) | |
| After: | |
| Dragonfly generated images from Nginx proxy_cache: 4099 req/sec (mean) |