Skip to content

Instantly share code, notes, and snippets.

@bidulock
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save bidulock/779e831e6bf014ff9aaa to your computer and use it in GitHub Desktop.

Select an option

Save bidulock/779e831e6bf014ff9aaa to your computer and use it in GitHub Desktop.
Add shell colour codes to a web page - bookmarklet
javascript:(function () {
var l = ['#000', '#A00', '#0A0', '#A50', '#00A', '#A0A', '#0AA', '#AAA'];
document.body.innerHTML = document.body.innerHTML.replace(/\u001b\[([0-9;]*)m/g, function (m, k) {
return k - 30 < 8 ? "<span style='color: " + l[k - 30] + "'>" : k == 39 ? "</span>" : "<span>";
});
document.body.style.backgroundColor = "#000";
document.body.style.color = "#AAA";
}());
@bidulock

bidulock commented Dec 5, 2014

Copy link
Copy Markdown
Author

A simple bookmarklet to make viewing log files generated as artifacts by jenkins nicer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment