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
daemon off; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
server { | |
listen 443 ssl; | |
location / { |
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
# Could also use the low-level ruby API client to make these calls: https://github.com/percy/percy-client |
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
function canvasToImage(canvas) { | |
const {top, left, height, width} = canvas.getBoundingClientRect(); | |
const mapImage = document.createElement('img'); | |
mapImage.setAttribute('src', canvas.toDataURL('image/png')); | |
mapImage.setAttribute('style', `position: absolute; z-index: 2147483638; top: ${top}px; left: ${left}px; width: ${width}px; height: ${height}px;`); | |
document.body.appendChild(mapImage); | |
}; | |
// Convert all canvas elements on the page to images. | |
document.querySelectorAll('canvas').forEach((canvas) => { |
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
git config --global push.default current | |
git config --global pull.default current |
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
class CustomLoader < Percy::Capybara::Loaders::SprocketsLoader | |
def build_resources | |
super.map do |resource| | |
resource.resource_url = resource.resource_url.gsub('//localhost:3000/', '/') | |
end | |
end | |
end | |
Percy::Capybara.use_loader(CustomLoader) |
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
jobs: | |
# ... | |
percy_finalize: | |
docker: | |
- image: circleci/node:10 | |
steps: | |
- run: npm install percy-client | |
- run: node .circleci/percy-finalize.js | |
workflows: |
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
# Tell Percy that this is a parallelized build. Because we separately finalize | |
# Percy builds, this should remain "2" no matter the actual number of nodes. | |
# | |
# Set this environment variable: | |
PERCY_PARALLEL_TOTAL=2 | |
# In your spec_helper, only call `initialize_build` and not finalize: | |
config.before(:suite) { Percy::Capybara.initialize_build } | |
# Do not call `finalize_build`. |
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
# Example to use Percy against a remote host. | |
# Requires: poltergeist gem, and phantomjs. | |
# | |
# This uses the percy-capybara native loader, which is slower and less accurate | |
# than other loaders. See: | |
# https://percy.io/docs/clients/ruby/capybara-other#non-rails-asset-setup | |
require 'percy/capybara' | |
require 'capybara/poltergeist' |
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
$('#ember-testing-container').css('height', '100%'); | |
$('#ember-testing-container').css('width', '100%'); | |
$('#ember-testing').css('zoom', '100%'); |
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
netstat -nat | awk '{print $6}' | sort | uniq -c | sort -n |
NewerOlder