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 'capybara/rails' | |
Capybara.register_driver(:headless_chrome) do |app| | |
args = %W[disable-gpu no-sandbox window-size=1680,1050] | |
args << 'headless' if ENV.fetch("HEADLESS", "1") == "1" | |
# args << "proxy-server=localhost:3128" | |
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( | |
chrome_options: { args: args } | |
) |
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
;; Syntax checker for haml | |
(flycheck-define-checker haml5 | |
"A Haml syntax checker using the Haml compiler. | |
See URL `http://haml.info'." | |
:command ("haml" "-c" source) | |
:error-patterns | |
((error line-start "Syntax error on line " line ": " (message) line-end) | |
(error line-start (file-name) ":" line ": syntax error, " (message) line-end)) | |
:modes haml-mode) |
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
# -*- coding: utf-8 -*- | |
# | |
# Purpose: | |
# Extend the date parsing capabilities of Ruby to work with dates with international month names. | |
# | |
# Usage: | |
# | |
# Date.parse_international(date_string) | |
# DateTime.parse_international(date_string) | |
# date_string.to_international_date |
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
" convert shoulda to rspec | |
function! Shoulda2Rspec() | |
exec ':%s/setup/before/gce' | |
exec ':%s/teardown/after/gce' | |
exec ":%s/should \\(\"\\|'\\)/it \\1should /gce" | |
exec ":%s/^\\(\\s\\+\\)should\\(_not\\)\\? \\([^\"'].*$\\)/\\1it { should\\2 \\3 }/gce" | |
exec ':%s/:\(\w\+\)\s\?=>\s\?/\1: /gce' | |
exec ':%s/assert_\([[:alpha:]]\+\)(\(.*\))/assert_\1 \2/gce' | |
exec ':%s/assert_contains \([^,]\+\), \?\(.*\)$/expect(\1).to include(\2)/gce' | |
exec ':%s/assert_does_not_contain \([^,]\+\), \?\(.*\)$/expect(\1).to_not include(\2)/gce' |