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
export function absoluteToRelative() { | |
const origin = window.location.origin; | |
const $internalElements = window.document.querySelectorAll(`[href^="${origin}"],[src^="${origin}"]`); | |
for (let $el of $internalElements) { | |
const attr = $el.hasAttribute('href') ? 'href' : 'src'; | |
const value = $el.getAttribute(attr); | |
$el.setAttribute(attr, value.replace(origin, '')); | |
} | |
} |
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
// access the cypress document | |
cy.document().then(doc => { | |
// create a new style tag | |
let $style = doc.createElement("style"); | |
// add percy-specific css | |
$style.innerHTML = "@media only percy { iframe { display: none !important; } };"; | |
// inject styles into the document | |
doc.body.head.appendChild($style); | |
}); |
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
;; mode line modes | |
(line-number-mode t) | |
(column-number-mode t) | |
(size-indication-mode t) | |
;; diff-hl reducer used ro replace the git-gutter reducer | |
(defun ww/diff-hl-reducer (acc it) | |
"A reducer to count added, removed, and modified lines for diff-hl." | |
(cl-destructuring-bind (added removed modified) acc | |
(let ((lines (nth 1 it)) |
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
it.immediately = window.it; | |
it.skip = it.immediately.skip; | |
it.only = itOnly; | |
it.still = itStill; | |
export default it; | |
function it(name, assertion) { | |
return !assertion ? it.immediately(name) : | |
it.immediately(name, _convergeOn(assertion)); | |
} |
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
(unless (package-installed-p 'dired+) | |
(package-install 'dired+)) | |
(require 'dired+) | |
(setq diredp-hide-details-initially-flag nil | |
diredp-hide-details-propagate-flag nil) | |
(diredp-toggle-find-file-reuse-dir 1) |