Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Bateman chrisbateman

View GitHub Profile
View react-simple.html
<!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 Mar 5, 2016
React-Webpack Quick Start
View index.html
<!doctype html>
<title>React</title>
<body>
<div id="App"></div>
<script src="bundle.js"></script>
</body>
@chrisbateman
chrisbateman / Active Element Logger.md
Last active Jan 10, 2019
Bookmarklet for logging the current document.activeElement
View Active Element Logger.md

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 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 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');
You can’t perform that action at this time.