Skip to content

Instantly share code, notes, and snippets.

@harsh183
Created May 5, 2019 07:12
Show Gist options
  • Save harsh183/1a0b92dd5c82a893e102baf2ecf97c85 to your computer and use it in GitHub Desktop.
Save harsh183/1a0b92dd5c82a893e102baf2ecf97c85 to your computer and use it in GitHub Desktop.
Opinated userscript that makes Paul Graham's website slightly nicer to me to read since I go there a lot.
// ==UserScript==
// @name Paul Graham website beautifier
// @version 1
// @grant none
// ==/UserScript==
// Based off http://bettermotherfuckingwebsite.com/
var styles = `
body {
margin: 40px auto;
max-width: 800px;
line-height: 1.4;
color: #444;
padding:0 10px
background: #EEEEEE
}
h1,h2,h3 {
line-height:1.2
}
`
var styleSheet = document.createElement("style");
styleSheet.type = "text/css";
styleSheet.innerText = styles;
document.head.appendChild(styleSheet);
// Font size has some sort of font tag at 2, increase it
fontTags = document.getElementsByTagName("font");
for (var i = 0; i < fontTags.length; i += 1) {
fontTags[i].setAttribute("size", 4);
}
document.body.appendChild("<h1>Paul Graham</h1>");
// TODO: Get table width to 800
// TODO: Figure out centering
@harsh183
Copy link
Author

harsh183 commented May 5, 2019

I used GreaseMonkey to run this but doesn't depend on it really.

@harsh183
Copy link
Author

harsh183 commented May 5, 2019

TODO: Make the foot notes back and forth - or maybe inline hmmm...

@harsh183
Copy link
Author

MIT License

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