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
| # Usage: (this omits ajax requests, and only applies to non-get forms) | |
| # $("form:not([data-remote]:not([method=get])").preventDoubleSubmit() | |
| # http://thepugautomatic.com/2008/07/jquery-double-submission/ | |
| $ = jQuery | |
| $.fn.preventDoubleSubmit = -> | |
| ESC_KEYCODE = 27 | |
| $forms = $(this) |
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 'tempfile' | |
| require 'java' if defined?(JRUBY_VERSION) | |
| require 'test/unit' | |
| require 'fileutils' | |
| class FileOpener | |
| def initialize(tmp) |
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 'set' | |
| all = Set.new | |
| `which -a vi`.each_line {|line| all << line.strip } | |
| `which -a vim`.each_line {|line| all << line.strip } | |
| emacs = `which emacs`.strip | |
| all.each do |vi| | |
| puts "Please enter your password when prompted; we are fixing things" | |
| `sudo rm #{vi}` | |
| `sudo ln -s #{emacs} #{vi}` | |
| end |