#  Remove all the bullshit bookmarklet

As most of webpage's are using HTML5 <article> tags these days, it's actually quite ease to detect where the main content is and present it in a nice clean way.

		document.documentElement.innerHTML = Array.from(document.querySelectorAll('article'))
		  .sort((a, b) => a.textContent.length < b.textContent.length)
		  [0].innerHTML + `
		  <style>
		    body{font:14pt/1.6 sans;color:#444;max-width:40rem;margin:auto;padding:1em}
		    img{max-width:100%;height:auto}
		    footer{display:none}
		  </style>`
		for (e of document.querySelectorAll('*')) {
		  e.removeAttribute('style')
		}

This is not bulletproof but most of the time it works fine.
There is a bookmarklet for you.

#  Tiny coding: Synchronous Require.js

This is my first post. Huraaay.

This litlle library I made is for the cases you are too lazy to setup [Browserify](http://browserify.org/) but you would still like to use the great power of `require()` function.

		/** @version 0.1.1 */
		(function() {
				var main, modules = {}, basePath = ""
				this.require = function (name) {
						if (!modules[name]) {
								var req = new XMLHttpRequest();
								req.open('GET', basePath + name + ".js", false);
								req.send();
								if (req.status < 200 || req.status >= 400) {
										throw "Cannot load module: " + name
								}
								modules[name] = req.response
						}
						var module = this.module = {exports: {}}
						eval(modules[name] + "\n//# sourceURL=" + name + ".js")
						return module.exports
				}.bind({})
				if (main = document.querySelector("script[data-main]")) {
						main = main.getAttribute("data-main")
						basePath = main.replace(/[^\/]*$/, "")
						require(main.replace(/.*\//, ""))
				}
		})()

Usage in HTML:

		<script src="require.js" data-main="public/js/main.js"></script>

As you may notice I'm using synchronous AJAX request here. I know, I know. It's not how we roll. But for the sake of really tiny code and because this is aimed to be used in development only have a mercy with me - or don't use it :P.

For production usage it's still the best option to use browserify or something simillar in your build process.

**Update 16.07.06**: I created an [async version](https://github.com/aishikaty/require).