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
#!/usr/bin/env sh | |
# Multiple vulnerabilities have been disclosed in RubyGems: | |
# https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/ | |
# | |
# And again in March 2019: | |
# https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html | |
# | |
# If you're an Rbenv user, here's any easy one-liner to upgrade to a | |
# safe version of Rubygems (2.7.8 / 3.0.3 or later) for each installed Ruby version: |
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
def with_mobile_window_size(&block) | |
original_size = page.current_window.size | |
page.current_window.resize_to(320, 480) | |
block.call | |
ensure | |
page.current_window.resize_to(*original_size) | |
end |
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 "rails_helper" | |
RSpec::Matchers.define_negated_matcher :not_be_present, :be_present | |
RSpec.describe "all matcher" do | |
it "cooperates with negated matchers" do | |
expect([nil, "", " "]).to all(not_be_present) | |
# Whereas this doesn't work: | |
# expect([nil, "", " "]).to_not all(be_present) |
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
class UniqueUserEmail < ActiveRecord::Migration[5.1] | |
def change | |
enable_extension :citext | |
change_column :users, :email, :citext | |
add_index :users, :email, unique: true | |
end | |
end |
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
#!/bin/sh | |
set -eu | |
failIfPresentInSpecs() { | |
REGEX=$1 | |
if find spec -type f -name "*_spec.rb" -exec grep -E "$REGEX" {} +; then | |
printf "\nFound focused specs\n" | |
exit 1 | |
fi |
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
#!/bin/sh | |
# Exit if any subcommand fails | |
set -e | |
# Install latest stable version of Chrome | |
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
sudo dpkg -i google-chrome.deb | |
sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome | |
rm google-chrome.deb |
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
8.5 |
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
var SeedReporter = function(baseReporterDecorator) { | |
baseReporterDecorator(this); | |
this.onBrowserComplete = function(browser, result) { | |
if (result.order && result.order.random && result.order.seed) { | |
this.write("%s: Randomized with seed %s\n", browser, result.order.seed); | |
} | |
}; | |
}; |
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
# Determine the feature list from the custom build URL in the source file, e.g.: | |
# Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load | |
has_features = [ | |
"fontface", | |
"backgroundsize", | |
"borderimage", | |
"borderradius", | |
"boxshadow", | |
"flexbox", |