Skip to content

Instantly share code, notes, and snippets.

@mohammed-io
Created October 4, 2020 08:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohammed-io/acae461995663455cbbdde9c878e8613 to your computer and use it in GitHub Desktop.
Save mohammed-io/acae461995663455cbbdde9c878e8613 to your computer and use it in GitHub Desktop.
Prints the resume from rxresu.me
<a id="link" href="">Print Rx Resume</a>
<script id="js">
function init() {
if (window.location.host != 'rxresu.me') {
if (!confirm("This supposed to run on https://rxresu.me/.\nRun anyway?")) {
return;
}
}
const resume = [...document.querySelectorAll('#page')].map(n => n.cloneNode(true))[0];
if (!resume) return alert("Resume not found on the page!");
document.body.append(resume);
print();
resume.remove();
}
</script>
<script>
addEventListener('load', () => {
const script = document.getElementById('js').innerHTML;
const href = script => `javascript:(${script})()`;
document.getElementById('link').href = href(script);
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment