This file contains 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: | |
// | |
// import { Controller } from 'stimulus' | |
// import { useEscapePressed } from './mixins/use-escape-pressed.js | |
// | |
// export default class extends Controller { | |
// connect () { | |
// useEscapePressed(this) | |
// } | |
// |
This file contains 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
// Trap Focus | |
// https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element | |
// | |
// Usage: | |
// | |
// import { Controller } from 'stimulus' | |
// import { useTrapFocus } from './mixins/use-trap-focus.js | |
// | |
// export default class extends Controller { |
This file contains 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
#!/bin/bash | |
# Bumps Rubocop, removes all fixed Cops from the list of exceptions, and adds any cops that haven't been fixed | |
# Run after some code refactoring, or periodically whenever rubocop is updated | |
bundle update rubocop rubocop-rspec | |
echo "" > .rubocop_todo.yml | |
bundle exec rubocop --auto-gen-config --exclude-limit 50 |
This file contains 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
# RFC822 Email Address Regex | |
# -———————————- | |
# Originally written by Cal Henderson | |
# c.f. http://iamcal.com/publish/articles/php/parsing_email/ | |
# | |
# Translated to Ruby by Tim Fletcher, with changes suggested by Dan Kubb. | |
# | |
# Licensed under a Creative Commons Attribution-ShareAlike 2.5 License | |
# http://creativecommons.org/licenses/by-sa/2.5/ | |
module RFC822 |