Skip to content

Instantly share code, notes, and snippets.


Chris Bateman chrisbateman

View GitHub Profile
View react-simple.html
<!doctype html>
<title>React Demo</title>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script type="text/babel">
chrisbateman / index.html
Last active Mar 5, 2016
React-Webpack Quick Start
View index.html
<!doctype html>
<div id="App"></div>
<script src="bundle.js"></script>
chrisbateman / Active Element
Last active Jan 10, 2019
Bookmarklet for logging the current document.activeElement
View Active Element

Bookmarklet: Active Element Logger

This will log the current document.activeElement to the console. Useful when debugging keyboard focus issues. Click once to turn it on, click again to turn it off.

Unfortunately, markdown gists aren't allowed to include JS in links, or this would work:

Active Element Logger

So you'll have to add this to your bookmarks the hard way:

chrisbateman / attr.js
Last active Aug 29, 2015
Simple utility for manipulating attribute values like you would with classes.
View attr.js
* Allows manipulation of attribute values in the same way that is commonly done with classes.
* Written as a helper for
* Use setPrefix() if you want to prefix all your attributes with "am-" or "data-am-", etc.
* @see
* @exports attr
* @example
* attr.setPrefix(node, 'css-');
* attr.toggle(node, 'badge');
* attr.toggle(node, 'badge', 'large');
You can’t perform that action at this time.