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
######################## | |
# CloudFlare Ranges Only | |
# | |
# Active non-WARP ranges as at: 7th May 2021 | |
# Latest list: for v in v4 v6;do curl "https://www.cloudflare.com/ips-$v";done | |
######################## | |
# Allow access to http (dport 80) | |
iptables -A INPUT -s 173.245.48.0/20 -p tcp --dport http -j ACCEPT | |
iptables -A INPUT -s 103.21.244.0/22 -p tcp --dport http -j ACCEPT |
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
// Anti-pattern conditional testing with Cypress | |
// Uses jQuery functionality to determine existence | |
// Add to your support folder | |
Cypress.Commands.add("exist", (selector) => { | |
cy.get('body').should('exist').then(($body) => { | |
return new Cypress.Promise((resolve, reject) => { | |
if ($body.find(selector).length > 0) { | |
console.log("cy.exist() - Matching element found in DOM!"); | |
resolve(true); |
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 addScreenshots() { | |
/* Credits: https://gist.github.com/kethinov/6658166#gistcomment-3178557 */ | |
/* Prepend the given path segment */ | |
const prependPathSegment = pathSegment => location => path.join(pathSegment, location); | |
/* fs.readdir but with relative paths */ | |
const readdirPreserveRelativePath = location => fs.readdirSync(location).map(prependPathSegment(location)); |