Skip to content

Instantly share code, notes, and snippets.

View chrisbateman's full-sized avatar

Chris Bateman chrisbateman

View GitHub Profile
<!doctype html>
<title>React Demo</title>
<script src="https://unpkg.com/react@15.3.2/dist/react-with-addons.min.js"></script>
<script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js"></script>
<script type="text/babel">
@chrisbateman
chrisbateman / index.html
Last active March 5, 2016 16:17
React-Webpack Quick Start
<!doctype html>
<title>React</title>
<body>
<div id="App"></div>
<script src="bundle.js"></script>
</body>
@chrisbateman
chrisbateman / Active Element Logger.md
Last active January 10, 2019 08:25
Bookmarklet for logging the current document.activeElement

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
chrisbateman / attr.js
Last active August 29, 2015 14:07
Simple utility for manipulating attribute values like you would with classes.
/**
* Allows manipulation of attribute values in the same way that is commonly done with classes.
* Written as a helper for http://amcss.github.io/
* Use setPrefix() if you want to prefix all your attributes with "am-" or "data-am-", etc.
* @see https://github.com/yui/yui3/blob/master/src/dom/js/dom-class.js
* @exports attr
* @example
* attr.setPrefix(node, 'css-');
* attr.toggle(node, 'badge');
* attr.toggle(node, 'badge', 'large');