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
if ENV['REMOTE'].eql?("true") | |
hub_url = 'http://localhost:4444/wd/hub' | |
capabilities = Selenium::WebDriver::Remote::Capabilities.send(ENV['DRIVER']) | |
capabilities['version'] = ENV['VERSION'] | |
capabilities['takesScreenshot'] = true | |
capabilities['javascriptEnabled'] = true | |
Capybara.register_driver :remote_browser do |app| | |
Capybara::Selenium::Driver.new( | |
app, |
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
# Source: https://robots.thoughtbot.com/automatically-wait-for-ajax-with-capybara | |
def wait_for_ajax | |
Timeout.timeout(Capybara.default_max_wait_time) do | |
loop until page.evaluate_script('jQuery.active').zero? | |
end | |
end | |
def wait_for_page_to_load | |
Timeout.timeout(Capybara.default_max_wait_time) do | |
loop until page.evaluate_script('document.readyState === 'complete') |
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
# If you want to make sure there's exactly one | |
find(".active").click | |
# If you just want the first element | |
find(".active", match: :first).click | |
# All matching elements | |
find(".active", match: :first) # Wait for the first element | |
all(".active").each(&:click) |
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
# List available versions | |
$brew search mysql | |
# Install required version | |
$brew install mysql@5.6 | |
# List running services | |
$brew services list | |
# Stop if mysql service is running |
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
{ | |
"cucumberautocomplete.steps": [ | |
"features/step_definitions/*.rb" | |
], | |
"cucumberautocomplete.syncfeatures": "features/*feature", | |
"workbench.editor.enablePreview": false | |
} | |
// Monorepo | |
{ |
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
# Run rubocop --auto-gen-config to generate config file | |
Metrics/AbcSize: | |
Enabled: false | |
Metrics/BlockLength: | |
Exclude: | |
- 'Rakefile' | |
- 'features/step_definitions/**/*' | |
Metrics/LineLength: | |
Enabled: false |
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
# ssh-keys fingerprint | |
ssh-keygen -E md5 -lf <fileName> | |
# List open ports | |
netstat -ap tcp | grep -i "listen" | |
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 | |
if [[ $OSTYPE != "darwin"* ]]; then | |
echo "This script is for Mac machines only" | |
exit | |
fi | |
if ! type "rvm" > /dev/null; then | |
echo "Install RVM and Ruby" | |
if ! type "gpg" > /dev/null; then |
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
# Compute file checksum - MD5, SHA1, SHA256 ... | |
certutil -hashfile z:\desktop\lsr.exe SHA512 |
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
Current session: | |
gnome-terminal --geometry=235x15+0+900 | |
Set default position and size: | |
1. cp /usr/share/applications/gnome-terminal.desktop ~/.local/share/applications | |
2. sed -i 's/^Exec=gnome-terminal$/& --geometry=235x15+0+900/' ~/.local/share/applications/gnome-terminal.desktop | |
3. gsettings set org.gnome.desktop.default-applications.terminal exec 'gnome-terminal --geometry=235x15+0+900' |
OlderNewer