A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
- Headers
- Links
- Bold
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
<?php | |
/* | |
* A walker class to use that extends wp_dropdown_categories and allows it to use the term's slug as a value rather than ID. | |
* | |
* See http://core.trac.wordpress.org/ticket/13258 | |
* | |
* Usage, as normal: | |
* wp_dropdown_categories($args); | |
* |
// Detect autoplay | |
// --------------- | |
// This script detects whether the current browser supports the | |
// autoplay feature for HTML5 Audio elements, and it sets the | |
// `AUTOPLAY` variable accordingly. | |
// Used in the Meteor app [PicDinner](http://picdinner.com) |
// Great for getting values, outputting context strings, and so on. | |
console.log(variable) | |
// Same as console.log(), but prints in yellow as a warning. Useful to show a non-breaking error in a dev env. | |
console.warn('It is a good idea to use .map instead of a for-loop.') | |
// Same as console.log(), but prints in red as an error. Useful to show a breaking error in a dev env. | |
console.error(`The value must be an integer. You provided a ${typeof variable}.`) | |
// Group console data together for better viewing. Nice to group console logs together. |
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication | |
// http://creativecommons.org/publicdomain/zero/1.0/ | |
(function (win, doc) { | |
// Cut the mustard. | |
if (!win.localStorage) return; | |
// You should probably use a more specific selector than this. | |
var textarea = doc.querySelector('textarea'); | |
// The key for the key/value pair in localStorage is the current URL. | |
var key = win.location.href; |