This helper has finally been moved into a gem called nav_lynx!
https://github.com/vigetlabs/nav_lynx
http://rubygems.org/gems/nav_lynx
Thanks to @brianjlandau and @reagent for getting that set up and tested!
| # Based on | |
| # https://github.com/ng/paperclip-watermarking-app/blob/master/lib/paperclip_processors/watermark.rb | |
| # Modified by Laurynas Butkus | |
| module Paperclip | |
| class Watermark < Processor | |
| # Handles watermarking of images that are uploaded. | |
| attr_accessor :format, :whiny, :watermark_path, :position | |
| def initialize file, options = {}, attachment = nil |
| require 'set' | |
| LOCK = Mutex.new | |
| num = Integer(ARGV.shift || 4) | |
| processes = Set.new | |
| Signal.trap "INT" do |s| | |
| $stderr.puts "Shutdown" |
| logger.warn "*** BEGIN RAW REQUEST HEADERS ***" | |
| self.request.env.each do |header| | |
| logger.warn "HEADER KEY: #{header[0]}" | |
| logger.warn "HEADER VAL: #{header[1]}" | |
| end | |
| logger.warn "*** END RAW REQUEST HEADERS ***" |
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
| # Search term parser from https://gist.github.com/1477730 | |
| # Modified to allow periods (and other non-letter chars) in unquoted field values | |
| # and field names. | |
| # | |
| # Helper class to help parse out more advanced saerch terms | |
| # from a form query | |
| # | |
| # Note: all hash keys are downcased, so ID:10 == {'id' => 10} | |
| # you can also access all keys with methods e.g.: terms.id = terms['id'] = 10 | |
| # this doesn't work with query as thats reserved for the left-over pieces |
| <% [:notice, :error, :alert].each do |level| %> | |
| <% unless flash[level].blank? %> | |
| <div class="alert-message <%= flash_class(level) %>"> | |
| <a class="close" href="#">×</a> | |
| <%= content_tag :p, flash[level] %> | |
| </div> | |
| <% end %> | |
| <% end %> |
| say "Create stub for '#{action_name = name.sub('rails_admin_', '')}' in gem '#{name}'. This may take a while" | |
| run "rm -rf script/ config/ lib/tasks/" | |
| run "rm -rf app/assets app/controllers app/helpers app/mailers app/models" | |
| run "mkdir -p app/views/rails_admin/main" | |
| inside "app/views/rails_admin/main" do | |
| create_file "#{action_name}.html.haml", <<-END | |
| %h2 Custom action loaded and active | |
| %pre @abstract_model.inspect | |
| %pre @object.inspect | |
| END |
| var p1 = { | |
| x: 20, | |
| y: 20 | |
| }; | |
| var p2 = { | |
| x: 40, | |
| y: 40 | |
| }; |
| Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled. | |
| Using the code from twitter bootstrap documentation page, this code is customized for table header. | |
| Create the table with following layout - | |
| <table class="table-fixed-header"> | |
| <thead class="header"> | |
| <tr> | |
| <th>Column 1</th> | |
| <th>Column 2</th> | |
| <th>Column 3</th> |
This helper has finally been moved into a gem called nav_lynx!
https://github.com/vigetlabs/nav_lynx
http://rubygems.org/gems/nav_lynx
Thanks to @brianjlandau and @reagent for getting that set up and tested!